11

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
3
  • 1
    I have never heard of this kind of limit! What kind of terminal are you running under? xterm? gnome-terminal? ssh? I cannot reproduce this. For me, stty rows accepts arbitrarily large numbers.
    – Celada
    Commented Apr 30, 2015 at 22:13
  • @Celada, just Ctrl+Alt+Fn. A single text mode terminal, not GUI. Commented Apr 30, 2015 at 22:37
  • OP is referring to a Linux console quirk, as discussed here. Commented Jun 13, 2016 at 23:43

4 Answers 4

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.

1

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

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .