From 98dcf43214da5f03055213f02f999b047a5f00d4 Mon Sep 17 00:00:00 2001 From: DeWitt Clinton Date: Wed, 28 May 2025 09:59:25 -0700 Subject: [PATCH] Add a keybinding for ctrl+w to delete the previous word. (#582) Adds the following new keybindings to the cli text input buffer: - `Ctrl+W` : Delete previous word --- packages/cli/src/ui/components/shared/text-buffer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/ui/components/shared/text-buffer.ts b/packages/cli/src/ui/components/shared/text-buffer.ts index 43a19150..6864da8c 100644 --- a/packages/cli/src/ui/components/shared/text-buffer.ts +++ b/packages/cli/src/ui/components/shared/text-buffer.ts @@ -1176,6 +1176,7 @@ export function useTextBuffer({ else if (key['ctrl'] && input === 'a') move('home'); else if (key['end']) move('end'); else if (key['ctrl'] && input === 'e') move('end'); + else if (key['ctrl'] && input === 'w') deleteWordLeft(); else if ( (key['meta'] || key['ctrl'] || key['alt']) && (key['backspace'] || input === '\x7f')