1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

allow skipping confirmation prompt after opening subprocess

This commit is contained in:
Ram Bhosale
2022-03-17 17:43:03 +11:00
committed by Jesse Duffield
parent 28c9d85141
commit 7be25a105d
3 changed files with 17 additions and 12 deletions

View File

@@ -95,6 +95,7 @@ confirmOnQuit: false
quitOnTopLevelReturn: false quitOnTopLevelReturn: false
disableStartupPopups: false disableStartupPopups: false
notARepository: 'prompt' # one of: 'prompt' | 'create' | 'skip' notARepository: 'prompt' # one of: 'prompt' | 'create' | 'skip'
promptToReturnFromSubprocess: true # display confirmation when subprocess terminates
keybinding: keybinding:
universal: universal:
quit: 'q' quit: 'q'

View File

@@ -11,11 +11,12 @@ type UserConfig struct {
QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"` QuitOnTopLevelReturn bool `yaml:"quitOnTopLevelReturn"`
Keybinding KeybindingConfig `yaml:"keybinding"` Keybinding KeybindingConfig `yaml:"keybinding"`
// OS determines what defaults are set for opening files and links // OS determines what defaults are set for opening files and links
OS OSConfig `yaml:"os,omitempty"` OS OSConfig `yaml:"os,omitempty"`
DisableStartupPopups bool `yaml:"disableStartupPopups"` DisableStartupPopups bool `yaml:"disableStartupPopups"`
CustomCommands []CustomCommand `yaml:"customCommands"` CustomCommands []CustomCommand `yaml:"customCommands"`
Services map[string]string `yaml:"services"` Services map[string]string `yaml:"services"`
NotARepository string `yaml:"notARepository"` NotARepository string `yaml:"notARepository"`
PromptToReturnFromSubprocess bool `yaml:"promptToReturnFromSubprocess"`
} }
type RefresherConfig struct { type RefresherConfig struct {
@@ -535,10 +536,11 @@ func GetDefaultConfig() *UserConfig {
BulkMenu: "b", BulkMenu: "b",
}, },
}, },
OS: GetPlatformDefaultConfig(), OS: GetPlatformDefaultConfig(),
DisableStartupPopups: false, DisableStartupPopups: false,
CustomCommands: []CustomCommand(nil), CustomCommands: []CustomCommand(nil),
Services: map[string]string(nil), Services: map[string]string(nil),
NotARepository: "prompt", NotARepository: "prompt",
PromptToReturnFromSubprocess: true,
} }
} }

View File

@@ -675,8 +675,10 @@ func (gui *Gui) runSubprocess(cmdObj oscommands.ICmdObj) error { //nolint:unpara
subprocess.Stderr = ioutil.Discard subprocess.Stderr = ioutil.Discard
subprocess.Stdin = nil subprocess.Stdin = nil
fmt.Fprintf(os.Stdout, "\n%s\n", style.FgGreen.Sprint(gui.Tr.PressEnterToReturn)) if gui.Config.GetUserConfig().PromptToReturnFromSubprocess {
fmt.Scanln() // wait for enter press fmt.Fprintf(os.Stdout, "\n%s", style.FgGreen.Sprint(gui.Tr.PressEnterToReturn))
fmt.Scanln() // wait for enter press
}
return err return err
} }