xonecas.io
64875
Mc

mini-coder / commit 27b1ad6

Merge pull request #1 from Vpr99/delete-words

Update CLI input word handling

Eric Skram2026-02-25 27b1ad68c037cb872cfe3f8dc4853a2ddeb7bf8d parent 7ac5781parent e2282fd

1 file changed

src/cli/input.ts+10−0
@@ -399,6 +399,16 @@ export async function readline(opts: {
399399 renderPrompt();
400400 continue;
401401 }
402+ // Alt+Backspace (delete word backward): ESC DEL
403+ if (raw === `${ESC}${BACKSPACE}`) {
404+ const end = cursor;
405+ while (cursor > 0 && buf[cursor - 1] === " ") cursor--;
406+ while (cursor > 0 && buf[cursor - 1] !== " ") cursor--;
407+ buf = buf.slice(0, cursor) + buf.slice(end);
408+ if (pasteBuffer && !buf.includes(PASTE_SENTINEL)) pasteBuffer = null;
409+ renderPrompt();
410+ continue;
411+ }
402412 if (raw === ESC) {
403413 process.stdout.write("\n");
404414 return { type: "interrupt" };