Ctrl-u not clearing input field #2413

Closed
opened 2026-02-16 17:35:30 -05:00 by yindo · 5 comments
Owner

Originally created by @d3vr on GitHub (Oct 31, 2025).

Originally assigned to: @kommander, @thdxr on GitHub.

Description

The rest of the readline keybindings are working fine (ctrl+w, alt+f, alt+b, ...) except for:

  • ctrl-u: not doing anything, supposed to clear the input field from current cursor position to beginning
  • ctrl-d: supposed to remove the next character in relation to the cursor, currently it's clearing the input field.

OpenCode version

1.0.2

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Arch Linux

Terminal

alacritty 0.16.1

Originally created by @d3vr on GitHub (Oct 31, 2025). Originally assigned to: @kommander, @thdxr on GitHub. ### Description The rest of the readline keybindings are working fine (ctrl+w, alt+f, alt+b, ...) except for: - `ctrl-u`: not doing anything, supposed to clear the input field from current cursor position to beginning - `ctrl-d`: supposed to remove the next character in relation to the cursor, currently it's clearing the input field. ### OpenCode version 1.0.2 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Arch Linux ### Terminal alacritty 0.16.1
yindo added the opentuibug labels 2026-02-16 17:35:30 -05:00
yindo closed this issue 2026-02-16 17:35:30 -05:00
Author
Owner

@jdanbrown commented on GitHub (Nov 6, 2025):

Here's a quick sketch of adding ctrl+u in the other issue for ctrl+f/ctrl+b, but I'm not sure if they should be added in directly in opencode, or lower down in opentui?

@jdanbrown commented on GitHub (Nov 6, 2025): Here's a quick sketch of adding `ctrl+u` in the other issue for `ctrl+f`/`ctrl+b`, but I'm not sure if they should be added in directly in opencode, or lower down in opentui? - https://github.com/sst/opencode/issues/4000#issuecomment-3499431862
Author
Owner

@kommander commented on GitHub (Nov 17, 2025):

ctrl+u now clears the current line from cursor to beginning, that seems to work for multiline input.

@kommander commented on GitHub (Nov 17, 2025): `ctrl+u` now clears the current line from cursor to beginning, that seems to work for multiline input.
Author
Owner

@kommander commented on GitHub (Nov 17, 2025):

ctrl+d is still overloaded with closing opencode, some people expect that, so there are conflicting expectations on what keybind should do what by default.

@kommander commented on GitHub (Nov 17, 2025): `ctrl+d` is still overloaded with closing opencode, some people expect that, so there are conflicting expectations on what keybind should do what by default.
Author
Owner

@jdanbrown commented on GitHub (Nov 18, 2025):

ctrl+d is still overloaded with closing opencode, some people expect that, so there are conflicting expectations on what keybind should do what by default.

imo it's working correctly (as of 1.0.76):

  • ctrl+d with empty input exits opencode
  • ctrl+d with non-empty input does delete-char

Both of these behaviors match readline:

Commands for Changing Text
       end-of-file (usually C-d)
              The character indicating end-of-file as set, for example,
              by [stty(1)](https://www.man7.org/linux/man-pages/man1/stty.1.html).  If this character is read when there are no
              characters on the line, and point is at the beginning of
              the line, readline interprets it as the end of input and
              returns EOF.
       delete-char (C-d)
              Delete the character at point.  If this function is bound
              to the same character as the tty EOF character, as C-d
              commonly is, see above for the effects.  This may also be
              bound to the Delete key on some keyboards.
@jdanbrown commented on GitHub (Nov 18, 2025): > `ctrl+d` is still overloaded with closing opencode, some people expect that, so there are conflicting expectations on what keybind should do what by default. imo it's working correctly (as of 1.0.76): - `ctrl+d` with empty input exits opencode - `ctrl+d` with non-empty input does delete-char Both of these behaviors match readline: - https://www.man7.org/linux/man-pages/man3/readline.3.html#EDITING_COMMANDS ``` Commands for Changing Text end-of-file (usually C-d) The character indicating end-of-file as set, for example, by [stty(1)](https://www.man7.org/linux/man-pages/man1/stty.1.html). If this character is read when there are no characters on the line, and point is at the beginning of the line, readline interprets it as the end of input and returns EOF. delete-char (C-d) Delete the character at point. If this function is bound to the same character as the tty EOF character, as C-d commonly is, see above for the effects. This may also be bound to the Delete key on some keyboards. ```
Author
Owner

@jdanbrown commented on GitHub (Nov 18, 2025):

Afaik this issue can be closed now, since the stated problems are now fixed (as of 1.0.76):

  • ctrl-u: not doing anything, supposed to clear the input field from current cursor position to beginning
  • ctrl-d: supposed to remove the next character in relation to the cursor, currently it's clearing the input field.
@jdanbrown commented on GitHub (Nov 18, 2025): Afaik this issue can be closed now, since the stated problems are now fixed (as of 1.0.76): > - `ctrl-u`: not doing anything, supposed to clear the input field from current cursor position to beginning > - `ctrl-d`: supposed to remove the next character in relation to the cursor, currently it's clearing the input field.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2413