How to resize a terminal window from program in linux? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to resize a terminal window from program in linux?

I have fedora distro. The task is to write a simple console unicode game which would display correctly only on specific terminal window size, say 50x80 symbols.

24th Nov 2019, 10:56 AM
Іван Давидчук
Іван Давидчук - avatar
1 Answer
+ 2
You can resize the terminal before starting the game. Running this command( requires xterm to be installed): resize -s 50 80 will resize your terminal to 50x80 symbols. Now you can write a simple shell script containing the above command and execute it or just directly execute by making system call in Cpp of any language.
25th Nov 2019, 10:03 AM
Шащи Ранжан
Шащи Ранжан - avatar