Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the width of a Windows console window?

People also ask

How do I change the width of a console in C#?

SetWindowSize() Method in C# Console. SetWindowSize(Int32, Int32) Method is used to change the height and width of the console window to the specified values. Syntax: public static void SetWindowSize (int width, int height); Parameters: width: The width of the console window measured in columns.

What is buffer size in console?

The size of a screen buffer is expressed in terms of a coordinate grid based on character cells. The width is the number of character cells in each row, and the height is the number of rows.


Simply run "mode cols,lines" to change the size of the current console window:

mode 120,60

will resize the console window to 120 columns and 60 lines


You can increase it manually by right-clicking the tray icon and entering the options dialog.

There are also third-party terminal emulators for Windows, such as Console:

Screenshot of Console


system("mode 45, 20");

This is a bad solution because it disables vertical scrolling.

This is better:

system("mode CON: COLS=120");

There is a window's api function to set the width. Here's a tut on it. http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles6.html