summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/shared/text-buffer.ts
diff options
context:
space:
mode:
authorDeWitt Clinton <[email protected]>2025-05-23 22:13:57 -0700
committerGitHub <[email protected]>2025-05-23 22:13:57 -0700
commit7a3a9066f96440dd1cdbfbc8be576648f7e73fe1 (patch)
tree5c899b04a477bb6f43b016925422d07eb264cd22 /packages/cli/src/ui/components/shared/text-buffer.ts
parent30080b9f4e0341a1b69f3ea4c2a7cffd88d77c8c (diff)
Add additional readline-like keybindings. (#524)
Adds the following conventional readline-like keybindings: - `Ctrl+H`: Delete the previous character. - `Ctrl+D`: Delete the next character. Additionally, remaps the Debug Console command from Ctrl+D to Ctrl+O, which had been first introduced in PR #486.
Diffstat (limited to 'packages/cli/src/ui/components/shared/text-buffer.ts')
-rw-r--r--packages/cli/src/ui/components/shared/text-buffer.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/cli/src/ui/components/shared/text-buffer.ts b/packages/cli/src/ui/components/shared/text-buffer.ts
index 789a909a..43a19150 100644
--- a/packages/cli/src/ui/components/shared/text-buffer.ts
+++ b/packages/cli/src/ui/components/shared/text-buffer.ts
@@ -1186,10 +1186,11 @@ export function useTextBuffer({
else if (
key['backspace'] ||
input === '\x7f' ||
+ (key['ctrl'] && input === 'h') ||
(key['delete'] && !key['shift'])
)
backspace();
- else if (key['delete']) del();
+ else if (key['delete'] || (key['ctrl'] && input === 'd')) del();
else if (input && !key['ctrl'] && !key['meta']) {
// Heuristic for paste: if input is longer than 1 char (potential paste)
// strip ANSI escape codes.