opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(tui): correct delete keybind behavior

Open slimewell opened this issue 1 week ago • 5 comments

Summary

  • fix option-delete to avoid removing a newline when deleting a single-word line
  • make cmd+backspace consistently delete to line start or join lines at boundaries
  • add default super+backspace binding for delete-to-line-start

Testing

  • bun dev (manual repro in TUI prompt)

Demo

  • uploading video

Fixes #6314, adds #436

slimewell avatar Jan 15 '26 09:01 slimewell

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

github-actions[bot] avatar Jan 15 '26 09:01 github-actions[bot]

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

github-actions[bot] avatar Jan 15 '26 09:01 github-actions[bot]

https://github.com/user-attachments/assets/0b5ac413-2550-4983-b19e-c91fe278da9a

slimewell avatar Jan 15 '26 10:01 slimewell

Is the behavior of input_delete_to_line_start in deleting newline characters when the input is not at the beginning of a line intentional?

LIHUA919 avatar Jan 15 '26 10:01 LIHUA919

Yes intentional, cmd+backspace only deletes the newline when the cursor is already at line start; mid-line it deletes back to line start and preserves the newline.

slimewell avatar Jan 15 '26 11:01 slimewell