8000 Bug: rewrite `choose-menu` such that it can handle more than `$LINES` · Issue #97 · bevry/dorothy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bug: rewrite choose-menu such that it can handle more than $LINES #97

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

Closed
balupton opened this issue Dec 1, 2021 · 8 comments
Closed
Labels
bug Broken or unexpected

Comments

@balupton
Copy link
Member
balupton commented Dec 1, 2021

Currently if there are more items than $LINES only the last parts will show, then everything will be more or less busted.

@balupton balupton changed the title Rewrite tty.bash such that it can be inline, and handle more than $ROWS Rewrite tty.bash such that it can be inline, and handle more than $LINES Dec 1, 2021
@balupton balupton added bug Broken or unexpected enhancement Improvement or suggestion labels Dec 3, 2021
@balupton
Copy link
Member Author
balupton commented Dec 3, 2021

This will be pretty difficult, but will be another leap in UX, from good to great.

@molleweide
Copy link
Collaborator

Ooh cool! This is gonna be so nice to follow.

8000

@balupton
Copy link
Member Author
balupton commented Dec 4, 2021

I'm thinking until Dorothy becomes more popular or becomes funded, this should suffice for more use cases:

if output >= $LINES (with an offset consideration too); then
    resize terminal to the max
    repeat check, if still fails, then fail with a link to this issue

As that will take a few hours, rather than a few days.

@balupton balupton changed the title Rewrite tty.bash such that it can be inline, and handle more than $LINES Rewrite choose-menu such that it can be inline, and handle more than $LINES Dec 4, 2021
@balupton balupton changed the title Rewrite choose-menu such that it can be inline, and handle more than $LINES Rewrite choose-menu such that it can handle more than $LINES Dec 4, 2021
@balupton balupton changed the title Rewrite choose-menu such that it can handle more than $LINES Bugfix: Rewrite choose-menu such that it can handle more than $LINES Sep 1, 2023
@balupton balupton changed the title Bugfix: Rewrite choose-menu such that it can handle more than $LINES Bugfix: rewrite choose-menu such that it can handle more than $LINES Sep 1, 2023
@balupton balupton changed the title Bugfix: rewrite choose-menu such that it can handle more than $LINES Bug: rewrite choose-menu such that it can handle more than $LINES Sep 1, 2023
@balupton
Copy link
Member Author
balupton commented Sep 8, 2023

One alternative to this would be to fallback to charm's gum.

@balupton balupton added this to the --default for all milestone Sep 9, 2023
@balupton
Copy link
Member Author

https://github.com/charmbracelet/gum has the same issue

@balupton balupton removed the enhancement Improvement or suggestion label Oct 25, 2023
@balupton
Copy link
Member Author
balupton commented Oct 26, 2023

Can use:

# https://www.gnu.org/software/coreutils/manual/html_node/fmt-invocation.html
fmt --width=$COLUMNS <<< ...
fmt $COLUMNS <<< ...

# https://www.gnu.org/software/coreutils/manual/html_node/fold-invocation.html
fold -w $COLUMNS <<< ... # doesn't work well

Then can count the lines it produces, and keep the items within the $ROWS

@balupton
Copy link
Member Author
balupton commented Oct 27, 2023

Using the formatting coreutils, I was able to accomplish this in about 4 hours. The difficulty was more in the required optimisations to keep it performant to not have flickers on each update, as well as how to handle paging in a way that makes sense with the constraints of the algorithm.

It's pushed to dev, and I'll test it over the day on different setups.

Notably, it also brings about big improvements to the styling and usability once again.

balupton added a commit that referenced this issue Oct 27, 2023
- is-tty: bash v3 compat
- setup-utils: implement defaults
@balupton
Copy link
Member Author

This is now merged to master. Took another 4 hours today to rewrite for performance, and refine the interactions. Woohoo on solving the last known bug in Dorothy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken or unexpected
Development

No branches or pull requests

2 participants
0