Giter Site home page Giter Site logo

Fullscreen option about boxen HOT 5 CLOSED

sindresorhus avatar sindresorhus commented on May 30, 2024
Fullscreen option

from boxen.

Comments (5)

sindresorhus avatar sindresorhus commented on May 30, 2024

A good pull request would be welcomed, but not something I personally need.

from boxen.

Caesarovich avatar Caesarovich commented on May 30, 2024

Coming back on this late.
I've experimented a bit, I've managed to create a stable height option. Next was the fullscreen option, which is just a boolean that sets width and height as the terminal's dimensions. Although after experimenting a bit with it I have to conclude that the fullscreen option does not work quite well, because on most terminals there is say 15 rows available, but after boxen prints out the 15 row box, the terminal will always add a line break or stuff like that. Thus far on every different terminals I've tried this option on, the top of the box gets cropped because the terminal adds one or more blank line in the output. I don't know if I explained it correctly but in short: It does not look good at all.

So should I keep fullscreen or only add height ?

from boxen.

LitoMore avatar LitoMore commented on May 30, 2024

The line break shows that because your CLI process finished.

But for some living process, the line break will not be a problem.

You could design your fullscreen API according to your requirement.

Something like this:

type FullscreenOption = 
	| boolean
	| (width: number, height: number) => [width: number, height: number];

// Default use
app({
	fullscreen: true
});

// With modifications
app({
	fullscreen: ([w, h]) => [w, h - 1]
});

BTW, I had a branch before but it's outdated now. I can back to this work when I have time.

from boxen.

LitoMore avatar LitoMore commented on May 30, 2024

If you have interest in this, I would like to help to review.

from boxen.

Caesarovich avatar Caesarovich commented on May 30, 2024

@LitoMore Your idea of the implementation is very nice ! I'll try implementing it as soon a I can !

from boxen.

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.