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

Clear logs #403

Open
Tam opened this issue Nov 21, 2022 · 11 comments · May be fixed by #460
Open

Clear logs #403

Tam opened this issue Nov 21, 2022 · 11 comments · May be fixed by #460
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Tam
Copy link

Tam commented Nov 21, 2022

It'd be really useful to be able to clear the logs view and only show new items as they come in.

This is possible when viewing the logs independently (i.e. via the m keybind) and using the clear command to clear the terminal, but I often find myself jumping between containers to check the logs, so being able to do this within the lazydocker context would be handy!

@Tam Tam added the enhancement New feature or request label Nov 21, 2022
@jesseduffield
Copy link
Owner

I agree this would be a great feature. It might also be quite easy i.e. just press a key and then clear the main view. I'm gonna put a good-first-issue label on this. If you wanna take a stab at this @Tam lemme know and I can point you to the right places in the code to make the changes

@jesseduffield jesseduffield added the good first issue Good for newcomers label Nov 21, 2022
@Tam
Copy link
Author

Tam commented Nov 22, 2022

It's been a minute since I last used Go @jesseduffield, but sure if you can point me in the right direction I'll try to find time soon to give it a shot!

@jesseduffield
Copy link
Owner

Awesome :)

So you'll want to add a keybinding handler in pkg/gui/main_panel.go called handleClearMain

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

    gui.Views.Main.Clear()
	return nil
}

and then you'll want to reference it from pkg/gui/keybindings.go like so:

		{
			ViewName: "main",
			Key:      gocui.KeyCtrlL,
			Modifier: gocui.ModNone,
			Handler:  wrappedHandler(gui.handleClearMain),
			Description: gui.Tr.ClearMain,
		},

You'll also need to add the keybinding's help text to pkg/i18n/english.go (that's what the gui.Tr.ClearMain thing refers to).

I'd see how that goes. We'll likely need to tweak it but that's a good starting spot

@26tanishabanik
Copy link

@jesseduffield, is anyone actively working on this issue right now?

@jesseduffield
Copy link
Owner

Did you get a chance to start on this @Tam ? If you want to give it a go @26tanishabanik I'm happy to assign you

@26tanishabanik
Copy link

26tanishabanik commented Nov 29, 2022

Did you get a chance to start on this @Tam ? If you want to give it a go @26tanishabanik I'm happy to assign you

I can give it a try @jesseduffield , though I have a question, how do I setup the local dev environment, is there specific doc for that?

@Tam
Copy link
Author

Tam commented Nov 29, 2022

@jesseduffield it’s probably gonna be a while before I have time, happy to let @26tanishabanik take the reins 👍

@26tanishabanik
Copy link

26tanishabanik commented Nov 30, 2022

ClearMain

@jesseduffield , what does KeyCtrlL mean?

@mark2185
Copy link
Contributor

I'd guess it's ctrl+L.

@26tanishabanik
Copy link

I'd guess it's ctrl+L.

Thanks @mark2185

@26tanishabanik
Copy link

@jesseduffield , ctrl+L is working, I am able to clear the logs, after moving my cursor to the logs tab

sunny-Ne5 added a commit to sunny-Ne5/lazydocker that referenced this issue Jul 19, 2023
@sunny-Ne5 sunny-Ne5 linked a pull request Jul 19, 2023 that will close this issue
jorgemxm pushed a commit to jorgemxm/lazydocker that referenced this issue Mar 2, 2024
jorgemxm pushed a commit to jorgemxm/lazydocker that referenced this issue Jun 12, 2024
jorgemxm pushed a commit to jorgemxm/lazydocker that referenced this issue Jul 27, 2024
jorgemxm pushed a commit to jorgemxm/lazydocker that referenced this issue Nov 23, 2024
jorgemxm pushed a commit to jorgemxm/lazydocker that referenced this issue Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants