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

gum table v0.14.4 broke height #660

Closed
uwe-schwarz opened this issue Aug 24, 2024 · 5 comments · Fixed by #716
Closed

gum table v0.14.4 broke height #660

uwe-schwarz opened this issue Aug 24, 2024 · 5 comments · Fixed by #716
Labels
bug Something isn't working cmd/table

Comments

@uwe-schwarz
Copy link

Describe the bug
--height=0 is taken literally and only displays the header row.

Additionally it crashes with pressing two times cursor down.

To Reproduce
Steps to reproduce the behavior:
echo -e "col1,col2,col3\nfoo,bar,baz" | gum table

Expected behavior
Display up to height lines, should default to something like before (10).

Screenshots
If applicable, add screenshots to help explain your problem.
Table:
image

Crash:
image

Desktop (please complete the following information):

  • OS: macOS 14.6.1
  • Terminal: iTerm
  • gum version 0.14.4
@GregPK
Copy link

GregPK commented Aug 26, 2024

Reproduced on the following setup:

Desktop (please complete the following information):

  • OS: Archlinux, kernel 6.6.47-1-lts
  • Terminal: alacritty
  • gum version 0.14.4

@meowgorithm meowgorithm added bug Something isn't working cmd/table labels Sep 1, 2024
@meowgorithm
Copy link
Member

Oof, thanks for flagging (and for the great report). We'll get this one patched.

@meowgorithm
Copy link
Member

meowgorithm commented Sep 2, 2024

So charmbracelet/bubbles#608 should fix the panic, but it looks like the regression happened in #640 (in response to #554).

It appears that the height is essentially defaulting to 1 now, which of course isn't ideal. What would probably be best is if we defaulted the height to 12 or so, and then used the number of lines in the input if it's less than that.

@hxlnt
Copy link

hxlnt commented Sep 6, 2024

A similar issue is showing up for me on gum file as well; only the first line is shown unless --height is explicitly passed in.

@meowgorithm
Copy link
Member

@hxlnt Noted, thank you!

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

Successfully merging a pull request may close this issue.

4 participants