summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTimo Clasen <[email protected]>2025-07-17 11:27:02 +0200
committerGitHub <[email protected]>2025-07-17 04:27:02 -0500
commit91ad64fedaafe7ef2864d6a2a2ea695c63c05432 (patch)
tree94810b61a041d5dc4a11b511831a916557024bcf
parent60b55f9d921805a4a9d38c9eed05a060df08df82 (diff)
downloadopencode-91ad64fedaafe7ef2864d6a2a2ea695c63c05432.tar.gz
opencode-91ad64fedaafe7ef2864d6a2a2ea695c63c05432.zip
fix(tui): user defined ctrl+z should take precedence over suspending (#1088)
-rw-r--r--packages/tui/internal/tui/tui.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/tui/internal/tui/tui.go b/packages/tui/internal/tui/tui.go
index 6210ab7b1..e5b578bc2 100644
--- a/packages/tui/internal/tui/tui.go
+++ b/packages/tui/internal/tui/tui.go
@@ -110,11 +110,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case tea.KeyPressMsg:
keyString := msg.String()
- // Handle Ctrl+Z for suspend
- if keyString == "ctrl+z" {
- return a, tea.Suspend
- }
-
// 1. Handle active modal
if a.modal != nil {
switch keyString {
@@ -277,6 +272,11 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return a, util.CmdHandler(commands.ExecuteCommandsMsg(matches))
}
+ // Fallback: suspend if ctrl+z is pressed and no user keybind matched
+ if keyString == "ctrl+z" {
+ return a, tea.Suspend
+ }
+
// 10. Fallback to editor. This is for other characters like backspace, tab, etc.
updatedEditor, cmd := a.editor.Update(msg)
a.editor = updatedEditor.(chat.EditorComponent)