feat(ui): use Tab to switch focus between shell and input (#14332)

This commit is contained in:
Jacob Richman
2026-01-12 15:30:12 -08:00
committed by GitHub
parent 2e8c6cfdbb
commit ca6786a28b
11 changed files with 180 additions and 114 deletions
+11 -1
View File
@@ -135,7 +135,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
const kittyProtocol = useKittyKeyboardProtocol();
const isShellFocused = useShellFocusState();
const { setEmbeddedShellFocused } = useUIActions();
const { mainAreaWidth } = useUIState();
const { mainAreaWidth, activePtyId } = useUIState();
const [justNavigatedHistory, setJustNavigatedHistory] = useState(false);
const escPressCount = useRef(0);
const [showEscapePrompt, setShowEscapePrompt] = useState(false);
@@ -829,6 +829,14 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
return;
}
if (keyMatchers[Command.TOGGLE_SHELL_INPUT_FOCUS_IN](key)) {
// If we got here, Autocomplete didn't handle the key (e.g. no suggestions).
if (activePtyId) {
setEmbeddedShellFocused(true);
}
return;
}
// Fall back to the text buffer's default input handling for all other keys
buffer.handleInput(key);
@@ -870,6 +878,8 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
kittyProtocol.enabled,
tryLoadQueuedMessages,
setBannerVisible,
activePtyId,
setEmbeddedShellFocused,
],
);