Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: exit CLI when user terminates process with CTRL-C while a pterm select is shown #3503

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(cli): exit on ctrl-C when pterm select is running
  • Loading branch information
mathnogueira committed Jan 8, 2024
commit 6d9523b6b8a82ed1317ae2b53d39a5f7faaf2504
3 changes: 3 additions & 0 deletions agent/ui/pterm.go
Original file line number Diff line number Diff line change
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