diff --git a/CHANGELOG.md b/CHANGELOG.md index 64025599d8..f09d6b0ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed `TextArea` cursor display on wrapped lines https://github.com/Textualize/textual/pull/6196 - Fixed `remove_children` not refreshing layout https://github.com/Textualize/textual/pull/6206 +### Added + +- Added support for the kitty keyboard protocol on Windows https://github.com/Textualize/textual/pull/6207 + ## [6.5.0] - 2025-10-31 ### Added diff --git a/src/textual/drivers/windows_driver.py b/src/textual/drivers/windows_driver.py index 3a908afbe7..04626940c9 100644 --- a/src/textual/drivers/windows_driver.py +++ b/src/textual/drivers/windows_driver.py @@ -97,6 +97,7 @@ def start_application_mode(self) -> None: self.write("\x1b[?25l") # Hide cursor self.write("\033[?1003h") self.write("\033[?1004h") # Enable FocusIn/FocusOut. + self.write("\x1b[>1u") # https://sw.kovidgoyal.net/kitty/keyboard-protocol/ self.flush() self._enable_bracketed_paste() @@ -124,6 +125,10 @@ def stop_application_mode(self) -> None: self._disable_bracketed_paste() self.disable_input() + # Disable the Kitty keyboard protocol. This must be done before leaving + # the alt screen. https://sw.kovidgoyal.net/kitty/keyboard-protocol/ + self.write("\x1b[