Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTRL+L clears logs #549

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pkg/gui/keybindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func (b *Binding) GetKey() string {
switch key {
case 27:
return "esc"
case 12:
return "Ctrl+L"
case 13:
return "enter"
case 32:
Expand Down Expand Up @@ -185,6 +187,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Modifier: gocui.ModNone,
Handler: gui.handleDonate,
},
{
ViewName: "containers",
Key: gocui.KeyCtrlL,
Modifier: gocui.ModNone,
Handler: wrappedHandler(gui.handleClearMain),
Description: gui.Tr.ClearMain,
},
{
ViewName: "containers",
Key: 'd',
Expand Down Expand Up @@ -262,6 +271,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.handleContainersOpenInBrowserCommand,
Description: gui.Tr.OpenInBrowser,
},
{
ViewName: "services",
Key: gocui.KeyCtrlL,
Modifier: gocui.ModNone,
Handler: wrappedHandler(gui.handleClearMain),
Description: gui.Tr.ClearMain,
},
{
ViewName: "services",
Key: 'u',
Expand Down Expand Up @@ -449,6 +465,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Modifier: gocui.ModNone,
Handler: gui.scrollRightMain,
},
{
ViewName: "main",
Key: gocui.KeyCtrlL,
Modifier: gocui.ModNone,
Handler: wrappedHandler(gui.handleClearMain),
Description: gui.Tr.ClearMain,
},
{
ViewName: "main",
Key: 'h',
Expand Down
9 changes: 9 additions & 0 deletions pkg/gui/main_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,12 @@ func (gui *Gui) handleMainClick() error {

return gui.switchFocus(gui.Views.Main)
}

func (gui *Gui) handleClearMain() error {
if gui.popupPanelFocused() {
return nil
}

gui.clearMainView()
return nil
}
2 changes: 2 additions & 0 deletions pkg/i18n/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ type TranslationSet struct {

LcNextScreenMode string
LcPrevScreenMode string
ClearMain string
FilterPrompt string
}

Expand Down Expand Up @@ -262,6 +263,7 @@ func englishSet() TranslationSet {

LcNextScreenMode: "next screen mode (normal/half/fullscreen)",
LcPrevScreenMode: "prev screen mode",
ClearMain: "clear main panel",
FilterPrompt: "filter",
}
}