saulpw / visidata

A terminal spreadsheet multitool for discovering and arranging data
http://visidata.org
GNU General Public License v3.0
7.87k stars 279 forks source link

vd is a great tool - but can I somehow preset the screen height? #372

Closed halloleo closed 4 years ago

halloleo commented 5 years ago

Description

I am paying around with visidata - and love it already. :-)

However I have sometimes trouble that it allocates more lines than aviable in my terminal emulater - whith the result that the top- line scrolls out of view.

Is there a way to specify via CLI options the number of lines vd should occupy?

saulpw commented 5 years ago

Hi @halloleo, glad you're enjoying it! There's no way to do this from the CLI, but you could add this to your .visidatarc:

@VisiData.property
def windowHeight(vd):
    return 11

@BaseSheet.property
def windowHeight(sheet):
    return 11

and then it would only use 11 lines. Not the easiest to update but if your windows are usually a particular height, maybe it will work for you.

saulpw commented 4 years ago

Now you can set LINES and/or COLUMNS envvars to manually indicate the number of lines/columns to use. Does not seem to work well if set greater than the actual number of lines/columns. But should work in your case, @halloleo.

halloleo commented 4 years ago

I tested it against the stable branch and it works! :-) Thanks a lot, @saulpw!

Only problem using env vars with standard names is that some terminal programs reset them on window resize, effectively overriding my choice. A variable VD_LINES would avoid this.

BTW, I tried the approach with the .visidatarc file, but then I get the message

AttributeError: type object 'VisiData' has no attribute 'property'