Giter Club home page Giter Club logo

Comments (6)

maaslalani avatar maaslalani commented on May 15, 2024 1

Yes, I am currently working on that right now. The list will take up as much space as it needs by default and if it has enough space to display inline it will otherwise if the list is too long it will enter AltScreen mode similar to how fzf does which will keep the screen intact when you return to it.

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

Hey, there is a --height option that you can use but I will look into if I can fix it when there aren't too many options to choose from automatically.

from gum.

zachoooo avatar zachoooo commented on May 15, 2024

It looks like the height option does work, but I need to manually set it each time and I need to update it whenever the length of the list changes. Would it be possible for the height to have an automatic option so that it takes up as much height as needed to display the list?

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

@zachoooo In the latest release, we enter AltScreen if there is no --height passed so it will clear the screen but then when the program exits everything will look as it was (no clear effect) which should solve most of your problems.

In the future, I will add detection to see if we can display the entire list inline and do that if the TerminalHeight - CursorLineHeight > ListHeight (i.e. there is enough space to display inline)

from gum.

zachoooo avatar zachoooo commented on May 15, 2024

Thanks! This is nice to have. For now I've just switched to using Python and had it calculate the height variable based on the length of the list I'm passing in.

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

Cool, this calculation should be done on gum's end soon enough. Also, you could use wc -l (https://en.wikipedia.org/wiki/Wc_(Unix)) to count the lines if you wanted to stay in bash land.

We will have this feature implemented once the cursor position can be queried so that we can accurately predict if the terminal has enough space to display the entire list.

from gum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.