From 5ec02f760ecb305d9e5a1cf3ec093093891440f6 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Fri, 20 Nov 2020 10:39:28 +0200 Subject: [PATCH] exec shell: remove shell config or option The option is never worked and can't properly work because almost all containers anyway using Ash/Dash from /bin/sh --- README.md | 1 - config/param.go | 5 ----- main.go | 5 ----- menus.go | 3 +-- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/README.md b/README.md index f2832fe..cb45a48 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,6 @@ Option | Description `-s` | select initial container sort field `-scale-cpu` | show cpu as % of system total `-v` | output version information and exit -`-shell` | exec shell to use (default: sh) ### Keybindings diff --git a/config/param.go b/config/param.go index dc334f5..281cc6c 100644 --- a/config/param.go +++ b/config/param.go @@ -12,11 +12,6 @@ var defaultParams = []*Param{ Val: "state", Label: "Container Sort Field", }, - &Param{ - Key: "shell", - Val: "sh", - Label: "Shell", - }, &Param{ Key: "columns", Val: "status,name,id,cpu,mem,net,io,pids", diff --git a/main.go b/main.go index 148bfe4..71b7dde 100644 --- a/main.go +++ b/main.go @@ -46,7 +46,6 @@ 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", "", "exec shell to use") ) flag.Parse() @@ -91,10 +90,6 @@ func main() { config.Toggle("scaleCpu") } - if *defaultShell != "" { - config.Update("shell", *defaultShell) - } - // init ui if *invertFlag { InvertColorMap() diff --git a/menus.go b/menus.go index d73f059..2871fe9 100644 --- a/menus.go +++ b/menus.go @@ -359,8 +359,7 @@ func ExecShell() MenuFn { ui.DefaultEvtStream.ResetHandlers() defer ui.DefaultEvtStream.ResetHandlers() - shell := config.GetVal("shell") - if err := c.Exec([]string{shell, "-c", "printf '\\e[0m\\e[?25h' && clear && " + shell}); err != nil { + if err := c.Exec([]string{"/bin/sh", "-c", "printf '\\e[0m\\e[?25h' && clear && /bin/sh"}); err != nil { log.StatusErr(err) }