Skip to content

Fit to terminalΒ #4

@hermanbanken

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.

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