From 7679d4a7fd2a69766101dcc930d988f97e811930 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Fri, 20 Nov 2020 10:31:00 +0200 Subject: [PATCH] exec shell: fix shell config Currently each time when ctop started it overwrites "shell" config with default value of program argument. This means that in fact default shell config is never worked at all. --- main.go | 2 +- menus.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index ea1ea7c..148bfe4 100644 --- a/main.go +++ b/main.go @@ -46,7 +46,7 @@ func main() { invertFlag = flag.Bool("i", false, "invert default colors") scaleCpu = flag.Bool("scale-cpu", false, "show cpu as % of system total") connectorFlag = flag.String("connector", "docker", "container connector to use") - defaultShell = flag.String("shell", "sh", "exec shell to use") + defaultShell = flag.String("shell", "", "exec shell to use") ) flag.Parse() diff --git a/menus.go b/menus.go index c3ca2af..7c79285 100644 --- a/menus.go +++ b/menus.go @@ -359,8 +359,8 @@ func ExecShell() MenuFn { ui.DefaultEvtStream.ResetHandlers() defer ui.DefaultEvtStream.ResetHandlers() - shell := config.Get("shell") - if err := c.Exec([]string{shell.Val, "-c", "printf '\\e[0m\\e[?25h' && clear && " + shell.Val}); err != nil { + shell := config.GetVal("shell") + if err := c.Exec([]string{shell, "-c", "printf '\\e[0m\\e[?25h' && clear && " + shell}); err != nil { log.Fatal(err) }