fix: esc button behavior

This commit is contained in:
2025-12-31 11:28:08 +02:00
parent ca06d0d7c1
commit 5703a61ddb
2 changed files with 10 additions and 2 deletions

View File

@@ -48,7 +48,6 @@ precommit:
echo "Running pre-commit checks..."; \
echo "go fmt"; \
go fmt ./...; \
git add $$STAGED_FILES; \
echo "go vet"; \
go vet ./...; \
echo "golangci-lint"; \

View File

@@ -295,7 +295,16 @@ func (m *model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
// Normal mode keybindings
switch msg.String() {
case "q", "esc", "ctrl+c":
case "q", "ctrl+c":
m.cancel()
return m, tea.Quit
case "esc":
// Clear filter if active, otherwise quit
if m.filter != "" {
m.filter = ""
m.updateFiltered()
return m, nil
}
m.cancel()
return m, tea.Quit