From 13f783d0bdee37502a78cb82aeaf6a7dc7faaa4f Mon Sep 17 00:00:00 2001 From: Jeff Connelly Date: Fri, 2 Jan 2026 11:00:59 -0800 Subject: [PATCH] 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. https://github.com/coder/ghostty-web/issues/109 Keyboard handling issues: Shift+Tab on macOS --- lib/input-handler.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/input-handler.ts b/lib/input-handler.ts index d362549..0ca319c 100644 --- a/lib/input-handler.ts +++ b/lib/input-handler.ts @@ -370,7 +370,11 @@ export class InputHandler { simpleOutput = '\r'; // Carriage return break; case Key.TAB: - simpleOutput = '\t'; // Tab + if (mods === Mods.SHIFT) { + simpleOutput = '\x1b[Z'; // Backtab + } else { + simpleOutput = '\t'; // Tab + } break; case Key.BACKSPACE: simpleOutput = '\x7F'; // DEL (most terminals use 0x7F for backspace)