Skip to content

Commit

Permalink
exec shell: remove shell config or option
Browse files Browse the repository at this point in the history
The option is never worked and can't properly work because almost all containers anyway using Ash/Dash from /bin/sh
  • Loading branch information
stokito committed Nov 20, 2020
1 parent 83a4229 commit 5ec02f7
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions config/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -91,10 +90,6 @@ func main() {
config.Toggle("scaleCpu")
}

if *defaultShell != "" {
config.Update("shell", *defaultShell)
}

// init ui
if *invertFlag {
InvertColorMap()
Expand Down
3 changes: 1 addition & 2 deletions menus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 5ec02f7

Please sign in to comment.