RESIZECONS(8)

๐Ÿ“ฆ
version 2.10.0 ยท 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

๐Ÿ’… resizecons(8) โ€” bestie edition ๐ŸŽ€

okay so this one lives in the System Manager's Manual, it's called resizecons, and it's about to change your whole console situation. literally. ๐ŸŒธ


โœจ NAME โœจ

resizecons โ€” change kernel idea of the console size ๐Ÿฆ‹

like, the kernel's opinion about how big your console is. we're gaslighting the kernel (affectionately). ๐Ÿ’–


๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

resizecons COLSxROWS
resizecons -lines ROWS

two ways in, bestie. pick your fighter. ๐Ÿ‘‘


๐Ÿ’ซ DESCRIPTION ๐Ÿ’ซ

The resizecons command tries to change the videomode of the console. and there's likeโ€ฆ several aspects to this, because of course there are:

  • (a) the kernel must know about it
  • (b) the hardware must know about it
  • (c) user programs must know about it
  • (d) the console font may have to be adapted

four whole problems. four. it's giving "group project where everyone has to pull their weight". ๐Ÿ˜ญ

(a) the kernel situation ๐Ÿง 

The kernel gets told about the change using the ioctl VT_RESIZE. This makes the kernel reallocate console screen memory for all virtual consoles, and ngl it might fail if there is not enough memory. (in that case? try to disallocate some virtual consoles first, babe. free up that real estate. ๐Ÿ )

โš ๏ธ and here's the messy part: if this ioctl succeeds, but a later step fails (e.g., because you do not have root permissions), you may be left with a very messy screen. like, screen all glitched out. tragic. ๐Ÿ’€

(b) the hardware situation ๐Ÿ–ฅ๏ธ

The most difficult part of this is (b), since it requires detailed knowledge of the video card hardware, and the setting of numerous registers. like, numerous. many. a lot. ๐Ÿ™ˆ

Only changing the number of rows is slightly easier, and resizecons will try to do that itself, when given the -lines option. (Probably, root permission will be required.) slay, but also: root, bestie. ๐Ÿ‘‘

The command resizecons COLSxROWS will execute restoretextmode -r COLSxROWS (and hence requires that you have svgalib installed). Here COLSxROWS is a file that was created earlier by restoretextmode -w COLSxROWS. Again, either root permissions are required, or restoretextmode has to be suid root. no cap. ๐Ÿ’…

(c) the user programs situation ๐Ÿ“ฃ

In order to deal with (c), resizecons does a stty rows ROWS cols COLS for each active console (in the range tty0..tty15), and sends a SIGWINCH signal to selection if it finds the file /tmp/selection.pid. yes, it's out here notifying everyone. it's giving "announcement in the group chat". ๐Ÿซถ

(d) the font situation ๐ŸŽ€

Finally, (d) is dealt with by executing a setfont command. Most likely, the wrong font is loaded, and you may want to do another setfont yourself afterwards. so likeโ€ฆ it tries its best, but you might need to clean up after it. ๐Ÿ˜ญ iconic behaviour honestly.


๐Ÿ”ฅ BUGS ๐Ÿ”ฅ

resizecons does not work on all hardware. fr fr, not every setup is gonna vibe with this. ๐Ÿฆ‹

also, fun lore drop: This command used to be called resize, but was renamed to avoid conflict with another command with the same name. two resizes could never coexist. main character energy only. ๐Ÿ‘‘


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

go read those too, bestie, they're all part of the lore. ๐Ÿ“šโœจ


kbd package, dated 17 Jan 1995 โ€” yeah this one's vintage, a true classic, and she still ate. ๐Ÿ’–๐ŸŽ€โœจ