fix(tui): accept Alt+G as Ctrl+G fallback in VSCode/Cursor terminals
VSCode and Cursor bind Ctrl+G to "Find Next" at the editor level, so the keystroke never reaches the embedded terminal — Ctrl+G to open \$EDITOR was effectively dead inside those IDEs. Alt+G is unbound in both editors and reaches the TUI cleanly as `\x1bg` → `key.meta && ch === 'g'` after parse-keypress. Accept it alongside the existing isAction(key, ch, 'g') check, and document the fallback in README + the hotkeys panel.
This commit is contained in:
@@ -366,7 +366,10 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult {
|
||||
return voiceRecordToggle()
|
||||
}
|
||||
|
||||
if (isAction(key, ch, 'g')) {
|
||||
// Alt+G is the escape hatch for terminals that swallow Ctrl+G — VSCode and
|
||||
// Cursor bind it to "Find Next" by default, so the keystroke never reaches
|
||||
// the embedded TUI. Alt+G arrives as `\x1bg` → meta+g across platforms.
|
||||
if (isAction(key, ch, 'g') || (key.meta && ch.toLowerCase() === 'g')) {
|
||||
return cActions.openEditor()
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const copyHotkeys: [string, string][] = isMac
|
||||
export const HOTKEYS: [string, string][] = [
|
||||
...copyHotkeys,
|
||||
[action + '+D', 'exit'],
|
||||
[action + '+G', 'open $EDITOR for prompt'],
|
||||
[action + '+G / Alt+G', 'open $EDITOR for prompt (Alt+G in VSCode/Cursor)'],
|
||||
[action + '+L', 'new session (clear)'],
|
||||
[paste + '+V / /paste', 'paste text; /paste attaches clipboard image'],
|
||||
['Tab', 'apply completion'],
|
||||
|
||||
Reference in New Issue
Block a user