Skip to content

Ctrl-u not clearing input field #3647

Closed

Description

@d3vr

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

Activity

  1. added
    bugSomething isn't working
    on Oct 31, 2025
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Oct 31, 2025
  3. self-assigned this
    on Oct 31, 2025
  4. jdanbrown commented on Nov 6, 2025

    @jdanbrown
    Contributor

    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?

  5. kommander commented on Nov 17, 2025

    @kommander
    Collaborator

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

  6. kommander commented on Nov 17, 2025

    @kommander
    Collaborator

    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.

  7. jdanbrown commented on Nov 18, 2025

    @jdanbrown
    Contributor

    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.
    
  8. jdanbrown commented on Nov 18, 2025

    @jdanbrown
    Contributor

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions