Skip to content

Commit

Permalink
feat: exit CLI when user terminates process with CTRL-C while a pterm…
Browse files Browse the repository at this point in the history
… select is shown (#3503)

feat(cli): exit on ctrl-C when pterm select is running
  • Loading branch information
mathnogueira committed Jan 8, 2024
1 parent b45a600 commit 6779759
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions agent/ui/pterm.go
Expand Up @@ -168,6 +168,9 @@ func (ui ptermUI) Select(prompt string, options []Option, defaultIndex int) (sel
MaxHeight: 5,
Selector: ">",
SelectorStyle: &pterm.ThemeDefault.SecondaryStyle,
OnInterruptFunc: func() {
os.Exit(0)
},
}).
Show()
if err != nil {
Expand Down

0 comments on commit 6779759

Please sign in to comment.