mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-22 15:11:02 +00:00
feat: bind Shift+M for mouse toggling and l for external logs pager
This commit is contained in:
parent
540d275fdc
commit
2fb00c354c
2 changed files with 32 additions and 0 deletions
|
|
@ -74,6 +74,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
Modifier: gocui.ModNone,
|
||||
Handler: gui.quit,
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: 'M', // Shift+M
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: wrappedHandler(gui.handleToggleMouse),
|
||||
Description: "Toggle mouse mode (ON/OFF)",
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gocui.KeyPgup,
|
||||
|
|
@ -234,6 +241,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
Handler: gui.handleContainerViewLogs,
|
||||
Description: gui.Tr.ViewLogs,
|
||||
},
|
||||
{
|
||||
ViewName: "containers",
|
||||
Key: 'l',
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleContainerViewLogsExternal,
|
||||
Description: "View logs with external pager",
|
||||
},
|
||||
{
|
||||
ViewName: "containers",
|
||||
Key: 'E',
|
||||
|
|
@ -318,6 +332,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
Handler: gui.handleServiceRenderLogsToMain,
|
||||
Description: gui.Tr.ViewLogs,
|
||||
},
|
||||
{
|
||||
ViewName: "services",
|
||||
Key: 'l',
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleServiceViewLogsExternal,
|
||||
Description: "View logs with external pager",
|
||||
},
|
||||
{
|
||||
ViewName: "services",
|
||||
Key: 'U',
|
||||
|
|
|
|||
|
|
@ -333,6 +333,17 @@ func (gui *Gui) handleServiceRenderLogsToMain(g *gocui.Gui, v *gocui.View) error
|
|||
return gui.runSubprocess(c)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleServiceViewLogsExternal(g *gocui.Gui, v *gocui.View) error {
|
||||
service, err := gui.Panels.Services.GetSelectedItem()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
if service.Container == nil {
|
||||
return gui.createErrorPanel("No container running for this service")
|
||||
}
|
||||
return gui.handleViewLogsExternal(service.Container)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleProjectUp(g *gocui.Gui, v *gocui.View) error {
|
||||
project, _ := gui.Panels.Projects.GetSelectedItem()
|
||||
if project != nil && project.Name != gui.DockerCommand.LocalProjectName {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue