summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Bhosale <rambhosale9@gmail.com>2022-03-17 17:43:03 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 17:52:31 +1100
commit7be25a105d389a262ef040133a4270f2f745d255 (patch)
tree722d07efdfbfd8aae5dff90b190694127bd85af1
parent28c9d85141bac6bc796f286d0a1161de48364887 (diff)
allow skipping confirmation prompt after opening subprocessv0.34
-rw-r--r--docs/Config.md1
-rw-r--r--pkg/config/user_config.go22
-rw-r--r--pkg/gui/gui.go6
3 files changed, 17 insertions, 12 deletions
diff --git a/docs/Config.md b/docs/Config.md
index 7134d1b8b..aac7f0349 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -95,6 +95,7 @@ confirmOnQuit: false
quitOnTopLevelReturn: false
disableStartupPopups: false
notARepository: 'prompt' # one of: 'prompt' | 'create' | 'skip'
+promptToReturnFromSubprocess: true # display confirmation when subprocess terminates
keybinding:
universal:
quit: 'q'
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 3b4e0f139..ac8a2bbc1 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -11,11 +11,12 @@ type UserConfig struct {
QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"`
Keybinding KeybindingConfig `yaml:"keybinding"`
// OS determines what defaults are set for opening files and links
- OS OSConfig `yaml:"os,omitempty"`
- DisableStartupPopups bool `yaml:"disableStartupPopups"`
- CustomCommands []CustomCommand `yaml:"customCommands"`
- Services map[string]string `yaml:"services"`
- NotARepository string `yaml:"notARepository"`
+ OS OSConfig `yaml:"os,omitempty"`
+ DisableStartupPopups bool `yaml:"disableStartupPopups"`
+ CustomCommands []CustomCommand `yaml:"customCommands"`
+ Services map[string]string `yaml:"services"`
+ NotARepository string `yaml:"notARepository"`
+ PromptToReturnFromSubprocess bool `yaml:"promptToReturnFromSubprocess"`
}
type RefresherConfig struct {
@@ -535,10 +536,11 @@ func GetDefaultConfig() *UserConfig {
BulkMenu: "b",
},
},
- OS: GetPlatformDefaultConfig(),
- DisableStartupPopups: false,
- CustomCommands: []CustomCommand(nil),
- Services: map[string]string(nil),
- NotARepository: "prompt",
+ OS: GetPlatformDefaultConfig(),
+ DisableStartupPopups: false,
+ CustomCommands: []CustomCommand(nil),
+ Services: map[string]string(nil),
+ NotARepository: "prompt",
+ PromptToReturnFromSubprocess: true,
}
}
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index e5bcd3c88..c6dbf1f65 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -675,8 +675,10 @@ func (gui *Gui) runSubprocess(cmdObj oscommands.ICmdObj) error { //nolint:unpara
subprocess.Stderr = ioutil.Discard
subprocess.Stdin = nil
- fmt.Fprintf(os.Stdout, "\n%s\n", style.FgGreen.Sprint(gui.Tr.PressEnterToReturn))
- fmt.Scanln() // wait for enter press
+ if gui.Config.GetUserConfig().PromptToReturnFromSubprocess {
+ fmt.Fprintf(os.Stdout, "\n%s", style.FgGreen.Sprint(gui.Tr.PressEnterToReturn))
+ fmt.Scanln() // wait for enter press
+ }
return err
}