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

memory leak in pager #823

Closed
themoonisacheese opened this issue Jan 27, 2025 · 8 comments · Fixed by #827
Closed

memory leak in pager #823

themoonisacheese opened this issue Jan 27, 2025 · 8 comments · Fixed by #827

Comments

@themoonisacheese
Copy link

themoonisacheese commented Jan 27, 2025

Describe the bug
gum pager no longer functions correctly as $PAGER, and seems to have a memory leak

To Reproduce
Steps to reproduce the behavior:

  1. in 0.15.1: in zshrc, have export PAGER="gum pager"
  2. open a command that would automatically use your pager, such as man tail
  3. gum pager opens, but no content is displayed, and the entire page is a small pink square with the controls displayed.
  4. gum pager uses 100% of 1 CPU, and fills the entire available ram in a few minutes. the server becomes understandably unresponsive and needs to be restarted.

Expected behavior
in 0.14-, this exact configuration worked as expected. man tail would correctly display inside gum pager without issues.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Almalinux 8
  • Version 0.15.1
@themoonisacheese
Copy link
Author

note that man tail | gum pager manually works just fine.

@caarlos0
Copy link
Member

hmm interesting, I can reproduce it here. Will take a look and get back to you soon.

Thanks for bringing this up <3

@caarlos0
Copy link
Member

FWIW, the problem seems to be soft-wrap, which was made default in v0.15.

As a workaround, you can use PAGER="gum pager --no-soft-wrap".

@caarlos0
Copy link
Member

this also seems to be fixed in #791

@caarlos0
Copy link
Member

fixed in #827

@caarlos0
Copy link
Member

hey @themoonisacheese, could you try this again on main?

if everything goes well, I'll make a patch release.

Thanks again for reporting this btw 🙏

@themoonisacheese
Copy link
Author

@caarlos0 seems to work fine with PAGER="./gum pager"(and staying in the repo of course) after building with go build

@caarlos0
Copy link
Member

thanks, gonna push a patch release soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants