Skip to content

Commit 98753e0

Browse files
authored
fix: send backtab escape sequence on Shift+Tab (#112)
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 242e38f commit 98753e0

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
@@ -393,7 +393,11 @@ export class InputHandler {
393393
simpleOutput = '\r'; // Carriage return
394394
break;
395395
case Key.TAB:
396-
simpleOutput = '\t'; // Tab
396+
if (mods === Mods.SHIFT) {
397+
simpleOutput = '\x1b[Z'; // Backtab
398+
} else {
399+
simpleOutput = '\t'; // Tab
400+
}
397401
break;
398402
case Key.BACKSPACE:
399403
simpleOutput = '\x7F'; // DEL (most terminals use 0x7F for backspace)

0 commit comments

Comments
 (0)