10

I would like some 83(cols)x40(rows) size on my TTY, so:

xubuntu@xubuntu:~$ stty size
30 90
xubuntu@xubuntu:~$ stty cols 83 rows 40
stty: standard input: Invalid argument
xubuntu@xubuntu:~$ stty size
30 83

As can be seen in my example, cols=40 is not supported on my computer.
So I must try:

xubuntu@xubuntu:~$ stty rows 39
stty: standard input: Invalid argument
xubuntu@xubuntu:~$ stty rows 38
stty: standard input: Invalid argument
xubuntu@xubuntu:~$ stty rows 37
stty: standard input: Invalid argument
xubuntu@xubuntu:~$ stty rows 36
xubuntu@xubuntu:~$

...until I success.

Is there any way to directly set stty to its maximum? Maybe something like:

xubuntu@xubuntu:~$ stty rows max

4 Answers4

5

stty is the wrong tool for this job. You want setupcon, which lets you choose a graphical font size to be displayed on the frame buffer console. The font size, combined with the resolution of the monitor, determines how many rows and columns you can see. stty is for telling a remote kernel you are accessing via a serial terminal what the actual size of your terminal display is.

psusi
  • 17,303
1

See my functions from this post for a solution using terminal codes: https://unix.stackexchange.com/a/283206

phk
  • 5,953
  • 7
  • 42
  • 71
1

As I pointed out in Set number of rows for gnome-terminal or other emulators:

Linux is unusual here: you can reduce the number of lines shown in the virtual console with that stty command (which makes an interesting effect with a virtual machine). Linux initializes the console to a mode which supports a given number of lines and columns. The stty command tells the console I/O driver to use less of it. A similar command to (attempt to) increase the size beyond the initialized mode limits fails.

Thomas Dickey
  • 76,765
0

IDK about a maximum but try:

# stty columns 83 rows 40

I actually use 160 x 55 myself and it works like a champ

Paul
  • 439
  • 3
  • 6