Skip to content

Commit 970ae12

Browse files
timoclsnnipuna-perera
authored andcommitted
fix(tui): user defined ctrl+z should take precedence over suspending (sst#1088)
1 parent aa66911 commit 970ae12

File tree

1 file changed

+5
-5
lines changed
  • packages/tui/internal/tui

1 file changed

+5
-5
lines changed

packages/tui/internal/tui/tui.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
110110
case tea.KeyPressMsg:
111111
keyString := msg.String()
112112

113-
// Handle Ctrl+Z for suspend
114-
if keyString == "ctrl+z" {
115-
return a, tea.Suspend
116-
}
117-
118113
// 1. Handle active modal
119114
if a.modal != nil {
120115
switch keyString {
@@ -277,6 +272,11 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
277272
return a, util.CmdHandler(commands.ExecuteCommandsMsg(matches))
278273
}
279274

275+
// Fallback: suspend if ctrl+z is pressed and no user keybind matched
276+
if keyString == "ctrl+z" {
277+
return a, tea.Suspend
278+
}
279+
280280
// 10. Fallback to editor. This is for other characters like backspace, tab, etc.
281281
updatedEditor, cmd := a.editor.Update(msg)
282282
a.editor = updatedEditor.(chat.EditorComponent)

0 commit comments

Comments
 (0)