Skip to content

Commit 13f783d

Browse files
committed
fix: send backtab escape sequence on Shift+Tab
Modified the TAB case in handleKeyDown to check for Shift modifier and send backtab escape sequence (\x1b[Z) instead of regular tab. #109 Keyboard handling issues: Shift+Tab on macOS
1 parent e3ec592 commit 13f783d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/input-handler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,11 @@ export class InputHandler {
370370
simpleOutput = '\r'; // Carriage return
371371
break;
372372
case Key.TAB:
373-
simpleOutput = '\t'; // Tab
373+
if (mods === Mods.SHIFT) {
374+
simpleOutput = '\x1b[Z'; // Backtab
375+
} else {
376+
simpleOutput = '\t'; // Tab
377+
}
374378
break;
375379
case Key.BACKSPACE:
376380
simpleOutput = '\x7F'; // DEL (most terminals use 0x7F for backspace)

0 commit comments

Comments
 (0)