mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-23 23:51:03 +00:00
return to the same panel after switching to a subprocess
This commit is contained in:
parent
71f05ff80a
commit
61a10f5cc7
3 changed files with 6 additions and 5 deletions
|
|
@ -211,7 +211,6 @@ func (gui *Gui) renderLogsForTTYContainer(container *commands.Container) error {
|
||||||
gui.clearMainView()
|
gui.clearMainView()
|
||||||
|
|
||||||
command := utils.ApplyTemplate(gui.Config.UserConfig.CommandTemplates.ContainerTTYLogs, container)
|
command := utils.ApplyTemplate(gui.Config.UserConfig.CommandTemplates.ContainerTTYLogs, container)
|
||||||
gui.Log.Warn(command)
|
|
||||||
cmd := gui.OSCommand.RunCustomCommand(command)
|
cmd := gui.OSCommand.RunCustomCommand(command)
|
||||||
|
|
||||||
// for some reason just saying cmd.Stdout = mainView does not work here as it does for non-tty containers, so we feed it through line by line
|
// for some reason just saying cmd.Stdout = mainView does not work here as it does for non-tty containers, so we feed it through line by line
|
||||||
|
|
@ -226,7 +225,6 @@ func (gui *Gui) renderLogsForTTYContainer(container *commands.Container) error {
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
// I might put a check on the stopped channel here. Would mean more code duplication though
|
// I might put a check on the stopped channel here. Would mean more code duplication though
|
||||||
mainView.Write(append(s.Bytes(), '\n'))
|
mainView.Write(append(s.Bytes(), '\n'))
|
||||||
gui.Log.Warn(s.Text())
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,11 +222,12 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if gui.g.CurrentView() == nil {
|
if gui.g.CurrentView() == nil {
|
||||||
if _, err := gui.g.SetCurrentView(gui.getContainersView().Name()); err != nil {
|
v, err := gui.g.View(gui.State.PreviousView)
|
||||||
return err
|
if err != nil {
|
||||||
|
v = gui.getServicesView()
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := gui.switchFocus(gui.g, nil, gui.getServicesView()); err != nil {
|
if err := gui.switchFocus(gui.g, nil, v); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ func (gui *Gui) RunWithSubprocesses() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) runCommand() error {
|
func (gui *Gui) runCommand() error {
|
||||||
|
gui.State.PreviousView = gui.currentViewName()
|
||||||
|
|
||||||
gui.SubProcess.Stdout = os.Stdout
|
gui.SubProcess.Stdout = os.Stdout
|
||||||
gui.SubProcess.Stderr = os.Stdout
|
gui.SubProcess.Stderr = os.Stdout
|
||||||
gui.SubProcess.Stdin = os.Stdin
|
gui.SubProcess.Stdin = os.Stdin
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue