Skip to content

Find, verify, and analyze leaked credentials

Allow users to exit the TUI when there are extra args (#4274)

Miccah301aade3086d
diff --git a/pkg/tui/tui.go b/pkg/tui/tui.go
index bba7f1bd4..9e833bffc 100644
--- a/pkg/tui/tui.go
+++ b/pkg/tui/tui.go
@@ -143,10 +143,16 @@ func (ui *TUI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch {
case key.Matches(msg, ui.common.KeyMap.Help):
case key.Matches(msg, ui.common.KeyMap.CmdQuit) && ui.activePage() != sourceConfigurePage:
+ ui.args = nil
return ui, tea.Quit
case key.Matches(msg, ui.common.KeyMap.Quit):
+ ui.args = nil
return ui, tea.Quit
- case ui.activePage() > 0 && key.Matches(msg, ui.common.KeyMap.Back):
+ case key.Matches(msg, ui.common.KeyMap.Back):
+ if ui.activePage() == wizardIntroPage {
+ ui.args = nil
+ return ui, tea.Quit
+ }
_ = ui.popHistory()
return ui, nil
}
@@ -159,6 +165,7 @@ func (ui *TUI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch item {
case wizard_intro.Quit:
+ ui.args = nil
cmds = append(cmds, tea.Quit)
case wizard_intro.ViewOSSProject:
ui.setActivePage(viewOSSProjectPage)