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

Choose and filter don't work well with long lines. #12

Open
james-antill opened this issue Jul 28, 2022 · 11 comments
Open

Choose and filter don't work well with long lines. #12

james-antill opened this issue Jul 28, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@james-antill
Copy link

% brew info gum | head -n 1
charmbracelet/tap/gum: stable 0.1.0

Easiest reproducers:

% ps axuw | gum filter

% ps axuw | gum choose

@maaslalani
Copy link
Contributor

Good catch! I will fix this soon with a scrollable viewport 👍

@maaslalani
Copy link
Contributor

Just confirming this only affects gum filter right? gum choose should be paginating long inputs.

image

@james-antill
Copy link
Author

Both here.

left/right arrows move to the next "page" for long results or move to the top/bottom for small results. Dito. h/l keys.

@james-antill
Copy link
Author

To be clear, this is a left/right problem ... not an up/down problem. Eg. 200 character lines on an 80 character wide terminal.

@maaslalani
Copy link
Contributor

maaslalani commented Jul 28, 2022

Ah I see, would truncation be a reasonable solution? Similar to what fzf does?

image

@cat-master21
Copy link

I also have this issue. The command I used is sqlite3 -batch -init /dev/null /var/cache/dnf/packages.db "select pkg from available where pkg like \"%\"" | gum filter which you can use on dnf based distros. If I replace gum with bat, sqlite3 -batch -init /dev/null /var/cache/dnf/packages.db "select pkg from available where pkg like \"%\"" | bat it works flawlessly.

@maaslalani
Copy link
Contributor

@cat-master21 bat and gum filter are not really comparable, you can probably use gum format instead and that will give you line-wrapping.

@maaslalani
Copy link
Contributor

@james-antill What is the solution you'd like to see?

@james-antill
Copy link
Author

james-antill commented Aug 3, 2022 via email

@muesli muesli added the bug Something isn't working label Oct 5, 2022
@maaslalani
Copy link
Contributor

Just a heads up that this will likely solve this issue: charmbracelet/bubbles#240

@keevan
Copy link
Contributor

keevan commented Nov 2, 2022

I encountered this issue myself today.

Horizontal scrolling would be nice, and as James pointed out it would be good to have an option where wrapping long lines is possible as well (if it's not too complex)

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

5 participants