ReviewOS

also looking at this

den-shell/den

fix(line-editor): Ctrl+K kills to end of line

#52
Merged chris wants to merge feat/line-editor-daily-fixes into main
1 file +1 -1
8 days ago

What

Ctrl+K (0x0B) in the interactive line editor was wired to clearScreen() — duplicating Ctrl+L and leaving the documented emacs kill-to-end-of-line unreachable. Ctrl+K is daily muscle memory for truncating a line, so this is a real papercut.

  • Ctrl+K now calls killToEnd() (which also pushes the killed text to the kill ring, so Ctrl+Y can yank it back). Clear-screen stays on Ctrl+L (0x0C).
  • Also removes a stray no-op self.killToEnd() self-recursion at the end of killToEnd() (it returned immediately via the cursor >= length guard, but was clearly unintended).

Verification

  • zig build clean.
  • PTY test: with the cursor before DROP in echo keepDROP, Ctrl+K leaves echo keep and runs it → prints keep.

Two-line behavioral change in src/utils/terminal/line_editor.zig; no API changes.

1 changed file on the files tab, with 0 review threads.

Sign in to comment on this pull request.