Giter Site home page Giter Site logo

Comments (5)

posva avatar posva commented on May 22, 2024 2

I want to keep the default behaviour to fit horizontally because it makes up for more pixels and we can always scroll. 0 to make it fit vertically sounds nice to me 👍

from catimg.

merwok avatar merwok commented on May 22, 2024 1

I see that the code does use an ioctl to get the columns! Could also return the lines.

I haven’t done much C but this could be a fun thing to write. I’m not available in the next weeks, so someone else feel free to take this!

from catimg.

posva avatar posva commented on May 22, 2024

I remember I didn't add it because there wasn't a consistent way of getting the height of the terminal, only the width.
I don't know if the situation has changed but I'm open to contributions if it has

from catimg.

merwok avatar merwok commented on May 22, 2024

Do you need the height in lines or pixels?

For lines, maybe some inspiration could be taken from Python. There is a function in the standard library that checks for the COLUMNS and LINES environment variables (ref http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html#tag_002_003 ), or calls an ioctl: python/cpython@bcf2b59#diff-a6f29e907cbb5fffd44d453bcd7b77d5R128

I supposes that calling stty size in a sub-process would make the program too slow?

from catimg.

merwok avatar merwok commented on May 22, 2024

Writing terminal_lines is easy but the command-line interface is harder, especially in the interaction of -w and the new flag. Could you define behaviour that you would accept?

  1. Change code from width to height, keep default to fit terminal
  2. Keep -w flag, add another flag for height (with value 0 to ask to fit height), error if both are given
  3. Something else?

(Value 0 to mean “do your best” inspired by make -j 0 meaning “use all processors”)

from catimg.

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.