Skip to content

Fit to terminal #4

Description

@hermanbanken

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions