Skip to content

Commit

Permalink
add exec shortcut key to container menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bcicen committed May 12, 2019
1 parent d7384db commit b8c38d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions menus.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func ContainerMenu() MenuFn {
items = append(items, menu.Item{Val: "stop", Label: "[s] stop"})
items = append(items, menu.Item{Val: "pause", Label: "[p] pause"})
items = append(items, menu.Item{Val: "restart", Label: "[r] restart"})
items = append(items, menu.Item{Val: "exec shell", Label: "[e]xec shell"})
items = append(items, menu.Item{Val: "exec", Label: "[e] exec shell"})
}
if c.Meta["state"] == "exited" || c.Meta["state"] == "created" {
items = append(items, menu.Item{Val: "start", Label: "[s] start"})
Expand Down Expand Up @@ -184,6 +184,10 @@ func ContainerMenu() MenuFn {
})
}
if c.Meta["state"] == "running" {
ui.Handle("/sys/kbd/e", func(ui.Event) {
selected = "exec"
ui.StopLoop()
})
ui.Handle("/sys/kbd/r", func(ui.Event) {
selected = "restart"
ui.StopLoop()
Expand Down Expand Up @@ -212,7 +216,7 @@ func ContainerMenu() MenuFn {
nextMenu = SingleView
case "logs":
nextMenu = LogMenu
case "exec shell":
case "exec":
nextMenu = ExecShell
case "start":
nextMenu = Confirm(confirmTxt("start", c.GetMeta("name")), c.Start)
Expand Down

0 comments on commit b8c38d0

Please sign in to comment.