Skip to content

OpenTUI: ctrl-z background controls are broken #3737

Closed

Description

@goniz

Description

Since OpenTUI got merged, the ctrl-z background controls functionality got masked by the text box undo feature

OpenCode version

1.0.11

Steps to reproduce

  1. open tui session
  2. write some prompt
  3. press ctrl-z
  4. text is undo'ed instead of going to background

Screenshot and/or share link

Screen.Recording.2025-11-02.at.10.46.00.mov

Operating System

macOS 26.0.1

Terminal

Ghostty

Activity

  1. added
    bugSomething isn't working
    on Nov 2, 2025
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 2, 2025
  3. kommander commented on Nov 4, 2025

    @kommander
    Collaborator

    Opencode needs to re-map the undo for the Textarea to not collide with other mappings.

  4. aymuos15 commented on Nov 4, 2025

    @aymuos15

    Could I take this up?

    I was thinking ctrl + Z can be undo and ctrl + shift + z can be suspend?

  5. goniz commented on Nov 4, 2025

    @goniz
    ContributorAuthor

    I've started to look into it.

    goniz@949f037

    Wdyt about this approach? It's not done yet but the suspend part works

    @kommander

  6. goniz commented on Nov 4, 2025

    @goniz
    ContributorAuthor

    Could I take this up?

    I was thinking ctrl + Z can be undo and ctrl + shift + z can be suspend?

    In my opinion the terminal's native behaviors should take priority over the textarea editing behavior.

  7. aymuos15 commented on Nov 4, 2025

    @aymuos15

    In warp, it is undo in its "text area" hence my suggestion but yeah, I get that.

  8. goniz commented on Nov 4, 2025

    @goniz
    ContributorAuthor

    In warp, it is undo in its "text area" hence my suggestion but yeah, I get that.

    So annoying 😂😵
    But yeah, that's my own preference

  9. added a commit that references this issue on Nov 9, 2025
    56aca3a
  10. kommander commented on Nov 17, 2025

    @kommander
    Collaborator

    ctrl+z should not be mapped by default anymore

  11. BrianVandenberg-vivint commented on Nov 18, 2025

    @BrianVandenberg-vivint

    As of 1.0.74 it's still not working on MacOS (in iTerm2 at least).

  12. goniz commented on Nov 18, 2025

    @goniz
    ContributorAuthor

    As of 1.0.74 it's still not working on MacOS (in iTerm2 at least).

    I have a PR open at #3983

    It's working but still has some artifacts due to incomplete shutdown sequence in opentui.
    I still haven't had the time to figure out and fix

  13. BrianVandenberg-vivint commented on Nov 18, 2025

    @BrianVandenberg-vivint

    If it matters, my 2¢: that's what /editor is for; get rid of undo & let ^Z do its default thing -> add an optional keybind for people who really really want undo in the TUI.

  14. goniz commented on Nov 18, 2025

    @goniz
    ContributorAuthor

    If it matters, my 2¢: that's what /editor is for; get rid of undo & let ^Z do its default thing -> add an optional keybind for people who really really want undo in the TUI.

    It's already implemented as you described.
    Undo&redo were mapped to alternative key bindings by @kommander and my PR implements the default terminal behavior to enable background and foreground terminal controls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp-wantedopentuiThis 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