Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize terminal from command?

I'm using cygwin but, is it possible to resize the terminal window via a command rather than doing it myself every time I open it? Some scripts I want to be a certain size for my own benefit.

like image 850
Aaron Avatar asked Feb 12 '26 15:02

Aaron


1 Answers

The 'CSI t' sequence can be used for that on xterm-compatible terminals. Search https://invisible-island.net/xterm/ctlseqs/ctlseqs.html for XTWINOPS for details.

For example, to resize to 50 rows and 80 columns.

echo -ne '\e[8;50;80t'
like image 115
ak2 Avatar answered Feb 15 '26 12:02

ak2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!