mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
chore: add suspend
This commit is contained in:
@@ -8,6 +8,7 @@ type KeyMap struct {
|
||||
Quit key.Binding
|
||||
Help key.Binding
|
||||
Commands key.Binding
|
||||
Suspend key.Binding
|
||||
Sessions key.Binding
|
||||
|
||||
pageBindings []key.Binding
|
||||
@@ -27,6 +28,10 @@ func DefaultKeyMap() KeyMap {
|
||||
key.WithKeys("ctrl+p"),
|
||||
key.WithHelp("ctrl+p", "commands"),
|
||||
),
|
||||
Suspend: key.NewBinding(
|
||||
key.WithKeys("ctrl+z"),
|
||||
key.WithHelp("ctrl+z", "suspend"),
|
||||
),
|
||||
Sessions: key.NewBinding(
|
||||
key.WithKeys("ctrl+s"),
|
||||
key.WithHelp("ctrl+s", "sessions"),
|
||||
|
||||
@@ -375,6 +375,11 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
|
||||
},
|
||||
)
|
||||
return tea.Sequence(cmds...)
|
||||
case key.Matches(msg, a.keyMap.Suspend):
|
||||
if a.app.CoderAgent.IsBusy() {
|
||||
return util.ReportWarn("Agent is busy, please wait...")
|
||||
}
|
||||
return tea.Suspend
|
||||
default:
|
||||
if a.dialog.HasDialogs() {
|
||||
u, dialogCmd := a.dialog.Update(msg)
|
||||
|
||||
Reference in New Issue
Block a user