mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 05:28:16 +00:00
fix(tui): user defined ctrl+z should take precedence over suspending (#1088)
This commit is contained in:
parent
60b55f9d92
commit
91ad64feda
1 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue