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

Unable to scroll the post-checkout hook error popup #4372

Open
TimShilov opened this issue Mar 7, 2025 · 1 comment
Open

Unable to scroll the post-checkout hook error popup #4372

TimShilov opened this issue Mar 7, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@TimShilov
Copy link

Describe the bug
When the post-checkout hook fails, lazygit shows the popup covering most of the UI with the output, which is great!
However, it seems like you can only scroll this output by one line, using j and k. Hitting Ctrl+d/Ctrl+u scrolls the git log underneath (which is barely even visible).
I'm working in a huge monorepo and sometimes the output is really big. The reason for the hook failure is usually at the very bottom of the output and to actually see it I have to hold j for a very long time and most of the time I just end up going outside of the lazygit to run the same command that the hook is running so that I can see the output.

To Reproduce
Steps to reproduce the behavior:

  1. Create a post-checkout hook in <repo root>/.git/hooks/post-checkout with the following content
#!/bin/bash

echo $(man less)
exit 1
  1. Make sure it's executable with sudo chmod +x .git/hooks/post-checkout.
  2. Switch to another branch by selecting it in the "Local branches" panel (3) and hitting Space.
  3. See the popup with an big output appear
  4. Try to scroll that popup.

Expected behavior
When the output popup is displayed, I would expect Crtl+d and Ctrl+u to scroll the popup contents rather than git log.
Maybe it would be reasonable to scroll to the end of the output automatically, because the popup shows Error and the error is most likely at the bottom of the output.

Screenshots

Image

Version info:
Run lazygit --version and paste the result here

commit=, build date=, build source=nix, version=0.48.0, os=darwin, arch=arm64, git version=2.39.5 (Apple Git-154)

Run git --version and paste the result here

git version 2.39.5 (Apple Git-154)

Additional context
I'm happy to try submitting a PR, but I haven't contributed to this project before so I'll need to spend some time digesting contributing guide and just getting familiar with the project.
If someone could point me to the right direction, that would also be highly appreciated!

@TimShilov TimShilov added the bug Something isn't working label Mar 7, 2025
@stefanhaller
Copy link
Collaborator

I have never liked ctrl-d/ctrl-u very much, I think they are crutches that were added because the main view can't be focused, so we need some way to scroll it. (Also, they scroll line by line too, so this wouldn't help much here?) I have been working on a branch that makes it possible to focus the main view, so that you can then navigate it with the same keys that we use in list views (arrow up/down or j/k to scroll by line, , and . to scroll by page, < and > to go to beginning/end).

For the error popup, I think that's what we should do too: support these four keys (,.<>). Let me know if you think this would solve it for you.

In the meantime, mouse wheel works in confirmation panels, so I can pretty quickly flick the view to the end using two fingers on my track pad.

Finally, for those who want to reproduce the issue: an easier way to do this is with a custom command like this:

customCommands:
  - command: man less
    context: global
    showOutput: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants