diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 04fb5ed1976c7cf7ba4af372dd16ecef48ceb82f..86390611f6115fc14def1e8a7713b252b0d6a59d 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -75,7 +75,7 @@ var DeleteKeyMaps = DeleteAttachmentKeyMaps{ key.WithHelp("ctrl+r+{i}", "delete attachment at index i"), ), Escape: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel delete mode"), ), DeleteAllAttachments: key.NewBinding( diff --git a/internal/tui/components/chat/editor/keys.go b/internal/tui/components/chat/editor/keys.go index 9d2274753b4667031bb43a76f54fce18c1decf51..8bc8b2354dfb72120d9e6173256635e903d012fd 100644 --- a/internal/tui/components/chat/editor/keys.go +++ b/internal/tui/components/chat/editor/keys.go @@ -61,7 +61,7 @@ var AttachmentsKeyMaps = DeleteAttachmentKeyMaps{ key.WithHelp("ctrl+r+{i}", "delete attachment at index i"), ), Escape: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel delete mode"), ), DeleteAllAttachments: key.NewBinding( diff --git a/internal/tui/components/chat/messages/messages.go b/internal/tui/components/chat/messages/messages.go index 5cc15d0303fb152f299aef9a2cdc596b9ffb57d4..296b02478a7d0738fef2f60ae6b2211d44424a2f 100644 --- a/internal/tui/components/chat/messages/messages.go +++ b/internal/tui/components/chat/messages/messages.go @@ -29,7 +29,7 @@ import ( var CopyKey = key.NewBinding(key.WithKeys("c", "y", "C", "Y"), key.WithHelp("c/y", "copy")) // ClearSelectionKey is the key binding for clearing the current selection in the chat interface. -var ClearSelectionKey = key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "clear selection")) +var ClearSelectionKey = key.NewBinding(key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "clear selection")) // MessageCmp defines the interface for message components in the chat interface. // It combines standard UI model interfaces with message-specific functionality. diff --git a/internal/tui/components/chat/splash/keys.go b/internal/tui/components/chat/splash/keys.go index 675c608a94af4aa72b701376f3983506166ac7d7..d36c8d8e7ee2231ef8bc27eb053a5745a0bd3885 100644 --- a/internal/tui/components/chat/splash/keys.go +++ b/internal/tui/components/chat/splash/keys.go @@ -46,7 +46,7 @@ func DefaultKeyMap() KeyMap { key.WithHelp("←/→", "switch"), ), Back: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "back"), ), } diff --git a/internal/tui/components/completions/keys.go b/internal/tui/components/completions/keys.go index 82372358028aec2b1384f1b4b6bff90be4a05eb8..dec1059f8cde34b7a65faad279ebe551a2108a3a 100644 --- a/internal/tui/components/completions/keys.go +++ b/internal/tui/components/completions/keys.go @@ -28,7 +28,7 @@ func DefaultKeyMap() KeyMap { key.WithHelp("enter", "select"), ), Cancel: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), DownInsert: key.NewBinding( diff --git a/internal/tui/components/dialogs/commands/keys.go b/internal/tui/components/dialogs/commands/keys.go index 9685216817c02cdfaab682f94e0f89aa64af365f..7b79a29c28a024154a3b4d8c763969585409fd00 100644 --- a/internal/tui/components/dialogs/commands/keys.go +++ b/internal/tui/components/dialogs/commands/keys.go @@ -31,7 +31,7 @@ func DefaultCommandsDialogKeyMap() CommandsDialogKeyMap { key.WithHelp("tab", "switch selection"), ), Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), } diff --git a/internal/tui/components/dialogs/compact/keys.go b/internal/tui/components/dialogs/compact/keys.go index c3dd98e13035085b7d46e7a2e94450b25a7f0d59..cec1486491e342c28f148a50d37f1129944c002e 100644 --- a/internal/tui/components/dialogs/compact/keys.go +++ b/internal/tui/components/dialogs/compact/keys.go @@ -33,7 +33,7 @@ func DefaultKeyMap() KeyMap { key.WithHelp("n", "no"), ), Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), } diff --git a/internal/tui/components/dialogs/filepicker/keys.go b/internal/tui/components/dialogs/filepicker/keys.go index 9f3b706e3cf677b66cbc3136a7b98a466470d949..72e32f2ab9dd07d8b7165aee74744e8be5fd78e8 100644 --- a/internal/tui/components/dialogs/filepicker/keys.go +++ b/internal/tui/components/dialogs/filepicker/keys.go @@ -38,7 +38,7 @@ func DefaultKeyMap() KeyMap { ), Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "close/exit"), ), } diff --git a/internal/tui/components/dialogs/keys.go b/internal/tui/components/dialogs/keys.go index c382b7e09e15de04efb5b2520bc490ef9d57b985..264ce3d42f6a99f441f961128f109e6baebf4c1b 100644 --- a/internal/tui/components/dialogs/keys.go +++ b/internal/tui/components/dialogs/keys.go @@ -12,7 +12,7 @@ type KeyMap struct { func DefaultKeyMap() KeyMap { return KeyMap{ Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), ), } } diff --git a/internal/tui/components/dialogs/models/keys.go b/internal/tui/components/dialogs/models/keys.go index df546863d87d3a68777e51938f58eee28a5c6473..ef4a6228b839c43a3862e251999dadf81dd6403f 100644 --- a/internal/tui/components/dialogs/models/keys.go +++ b/internal/tui/components/dialogs/models/keys.go @@ -34,7 +34,7 @@ func DefaultKeyMap() KeyMap { key.WithHelp("tab", "toggle type"), ), Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), } diff --git a/internal/tui/components/dialogs/quit/keys.go b/internal/tui/components/dialogs/quit/keys.go index 3268749b20c703ae1faf7640e253ce557f051c65..2e8dbc199264eb9221544319f81ef859d71e58b5 100644 --- a/internal/tui/components/dialogs/quit/keys.go +++ b/internal/tui/components/dialogs/quit/keys.go @@ -37,7 +37,7 @@ func DefaultKeymap() KeyMap { key.WithHelp("tab", "switch options"), ), Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), } diff --git a/internal/tui/components/dialogs/sessions/keys.go b/internal/tui/components/dialogs/sessions/keys.go index a3ca4b31f0c04c491fa7990f7e69ac546f608a7d..bc7ec1ba9f83915caee9189504abf0b07bd4a24b 100644 --- a/internal/tui/components/dialogs/sessions/keys.go +++ b/internal/tui/components/dialogs/sessions/keys.go @@ -26,7 +26,7 @@ func DefaultKeyMap() KeyMap { key.WithHelp("↑", "previous item"), ), Close: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), } diff --git a/internal/tui/page/chat/chat.go b/internal/tui/page/chat/chat.go index 88523388e31824a65d7e9922b89a1886a5fbcc0d..2918925068cb2f012bead47bbf44260c6255288c 100644 --- a/internal/tui/page/chat/chat.go +++ b/internal/tui/page/chat/chat.go @@ -766,7 +766,7 @@ func (p *chatPage) Bindings() []key.Binding { cancelBinding := p.keyMap.Cancel if p.isCanceling { cancelBinding = key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "press again to cancel"), ) } @@ -835,7 +835,7 @@ func (p *chatPage) Help() help.KeyMap { shortList = append(shortList, // Go back key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "back"), ), ) @@ -870,7 +870,7 @@ func (p *chatPage) Help() help.KeyMap { key.WithHelp("tab/enter", "complete"), ), key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), key.NewBinding( @@ -885,18 +885,18 @@ func (p *chatPage) Help() help.KeyMap { } if p.app.CoderAgent != nil && p.app.CoderAgent.IsBusy() { cancelBinding := key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ) if p.isCanceling { cancelBinding = key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "press again to cancel"), ) } if p.app.CoderAgent != nil && p.app.CoderAgent.QueuedPrompts(p.session.ID) > 0 { cancelBinding = key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "clear queue"), ) } @@ -1042,7 +1042,7 @@ func (p *chatPage) Help() help.KeyMap { key.WithHelp("ctrl+r+r", "delete all attachments"), ), key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel delete mode"), ), }) diff --git a/internal/tui/page/chat/keys.go b/internal/tui/page/chat/keys.go index ef896aaab10fe36ee8ce88d3f70a3f03e3c61d3e..679a97c69522c0e831e59bddc7b0c1ddcc55fbb9 100644 --- a/internal/tui/page/chat/keys.go +++ b/internal/tui/page/chat/keys.go @@ -23,7 +23,7 @@ func DefaultKeyMap() KeyMap { key.WithHelp("ctrl+f", "add attachment"), ), Cancel: key.NewBinding( - key.WithKeys("esc"), + key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "cancel"), ), Tab: key.NewBinding(