From 2fb00c354c32b50d5244a2c9078169ad6ca90a00 Mon Sep 17 00:00:00 2001 From: hunchulchoi Date: Thu, 4 Jun 2026 17:46:05 +0900 Subject: [PATCH] feat: bind Shift+M for mouse toggling and l for external logs pager --- pkg/gui/keybindings.go | 21 +++++++++++++++++++++ pkg/gui/services_panel.go | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index df706024..302ffb46 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -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', diff --git a/pkg/gui/services_panel.go b/pkg/gui/services_panel.go index edc894e9..7097ebc5 100644 --- a/pkg/gui/services_panel.go +++ b/pkg/gui/services_panel.go @@ -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 {