Skip to content

Commit

Permalink
Merge pull request #4781 from TomJGooding/fix-disable-kitty-keyboard-…
Browse files Browse the repository at this point in the history
…before-leaving-alt-screen

fix: disable kitty keyboard before leaving alt screen
  • Loading branch information
willmcgugan authored Jul 20, 2024
2 parents 0272c97 + e5a7822 commit 4506a7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Fixed

- Fixed issues in Kitty terminal after exiting app https://github.com/Textualize/textual/issues/4779

## [0.73.0] - 2024-07-18

### Added
Expand Down
6 changes: 3 additions & 3 deletions src/textual/drivers/linux_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ def stop_application_mode(self) -> None:
except termios.error:
pass

# Disable the Kitty keyboard protocol. This must be done before leaving
# the alt screen. https://sw.kovidgoyal.net/kitty/keyboard-protocol/
self.write("\x1b[<u")
# Alt screen false, show cursor
self.write("\x1b[?1049l")
self.write("\x1b[?25h")
self.write("\x1b[?1004l") # Disable FocusIn/FocusOut.
self.write(
"\x1b[<u"
) # Disable https://sw.kovidgoyal.net/kitty/keyboard-protocol/
self.flush()

def close(self) -> None:
Expand Down

0 comments on commit 4506a7e

Please sign in to comment.