fix(tui): reset extended keyboard modes

This commit is contained in:
Brooklyn Nicholson 2026-04-30 12:05:15 -05:00
parent 87e259a678
commit cad7944b92
3 changed files with 6 additions and 0 deletions

2
cli.py
View file

@ -1556,6 +1556,8 @@ _TERMINAL_INPUT_MODE_RESET_SEQ = (
"\x1b[?1004l" # disable focus events
"\x1b[?2004l" # disable bracketed paste
"\x1b[?1049l" # leave alt screen (if stuck there)
"\x1b[<u" # pop kitty keyboard mode
"\x1b[>4m" # reset modifyOtherKeys
"\x1b[0m" # reset text attributes
"\x1b[?25h" # ensure cursor visible
)

View file

@ -11,6 +11,8 @@ describe('terminal mode reset', () => {
expect(TERMINAL_MODE_RESET).toContain('\x1b[?1004l')
expect(TERMINAL_MODE_RESET).toContain('\x1b[?2004l')
expect(TERMINAL_MODE_RESET).toContain('\x1b[?1049l')
expect(TERMINAL_MODE_RESET).toContain('\x1b[<u')
expect(TERMINAL_MODE_RESET).toContain('\x1b[>4m')
})
it('writes reset sequence to TTY streams without fds', () => {

View file

@ -8,6 +8,8 @@ export const TERMINAL_MODE_RESET =
'\x1b[?1004l' + // focus events
'\x1b[?2004l' + // bracketed paste
'\x1b[?1049l' + // alternate screen
'\x1b[<u' + // kitty keyboard
'\x1b[>4m' + // modifyOtherKeys
'\x1b[0m' + // attributes
'\x1b[?25h' // cursor visible