OpenTUI: ctrl-z background controls are broken #2474

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

Originally created by @goniz on GitHub (Nov 2, 2025).

Originally assigned to: @kommander on GitHub.

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

https://github.com/user-attachments/assets/3dc13815-5139-48c5-a9cd-d7ede26fb85b

Operating System

macOS 26.0.1

Terminal

Ghostty

Originally created by @goniz on GitHub (Nov 2, 2025). Originally assigned to: @kommander on GitHub. ### 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 https://github.com/user-attachments/assets/3dc13815-5139-48c5-a9cd-d7ede26fb85b ### Operating System macOS 26.0.1 ### Terminal Ghostty
yindo added the help-wantedopentuibuggood first issue labels 2026-02-16 17:35:48 -05:00
yindo closed this issue 2026-02-16 17:35:49 -05:00
Author
Owner

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

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

@kommander commented on GitHub (Nov 4, 2025): Opencode needs to re-map the undo for the Textarea to not collide with other mappings.
Author
Owner

@aymuos15 commented on GitHub (Nov 4, 2025):

Could I take this up?

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

@aymuos15 commented on GitHub (Nov 4, 2025): Could I take this up? I was thinking ctrl + Z can be undo and ctrl + shift + z can be suspend?
Author
Owner

@goniz commented on GitHub (Nov 4, 2025):

I've started to look into it.

https://github.com/goniz/opencode/commit/949f037d5ad60856aea25f0efe6343ff5f110cdd

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

@kommander

@goniz commented on GitHub (Nov 4, 2025): I've started to look into it. https://github.com/goniz/opencode/commit/949f037d5ad60856aea25f0efe6343ff5f110cdd Wdyt about this approach? It's not done yet but the suspend part works @kommander
Author
Owner

@goniz commented on GitHub (Nov 4, 2025):

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.

@goniz commented on GitHub (Nov 4, 2025): > 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.
Author
Owner

@aymuos15 commented on GitHub (Nov 4, 2025):

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

@aymuos15 commented on GitHub (Nov 4, 2025): In warp, it is undo in its "text area" hence my suggestion but yeah, I get that.
Author
Owner

@goniz commented on GitHub (Nov 4, 2025):

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

@goniz commented on GitHub (Nov 4, 2025): > 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
Author
Owner

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

ctrl+z should not be mapped by default anymore

@kommander commented on GitHub (Nov 17, 2025): `ctrl+z` should not be mapped by default anymore
Author
Owner

@BrianVandenberg-vivint commented on GitHub (Nov 18, 2025):

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

@BrianVandenberg-vivint commented on GitHub (Nov 18, 2025): As of 1.0.74 it's still not working on MacOS (in iTerm2 at least).
Author
Owner

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

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

I have a PR open at https://github.com/sst/opencode/pull/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

@goniz commented on GitHub (Nov 18, 2025): > As of 1.0.74 it's still not working on MacOS (in iTerm2 at least). I have a PR open at https://github.com/sst/opencode/pull/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
Author
Owner

@BrianVandenberg-vivint commented on GitHub (Nov 18, 2025):

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.

@BrianVandenberg-vivint commented on GitHub (Nov 18, 2025): 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.
Author
Owner

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

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

@goniz commented on GitHub (Nov 18, 2025): > 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2474