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

Fit to terminal #4

Open
hermanbanken opened this issue Dec 24, 2013 · 0 comments
Open

Fit to terminal #4

hermanbanken opened this issue Dec 24, 2013 · 0 comments

Comments

@hermanbanken
Copy link

Currently lines are wrapped, but it would be sweet if we fit to the terminal window and indent the wrapped lines.

The only way to get the terminal size is listed below (according to toby)

function getTermSize(cb){
    require('child_process').spawn('resize').stdout.on('data', function(data){
        data = String(data)
        var lines = data.split('\n'),
            cols = Number(lines[0].match(/^COLUMNS=([0-9]+);$/)[1]),
            lines = Number(lines[1].match(/^LINES=([0-9]+);$/)[1])
        if (cb)
            cb(cols, lines)
    })
}

We could then determine how much padding is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant