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

前端 未结 11 2201
一向
一向 2020-12-05 07:06

Is it possible to programmatically, or otherwise, increase the width of the Windows console window? Or do I need to create a wrapper program that looks and acts like the con

相关标签:
11条回答
  • 2020-12-05 07:27

    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

    0 讨论(0)
  • 2020-12-05 07:28

    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

    0 讨论(0)
  • 2020-12-05 07:31

    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:

    0 讨论(0)
  • 2020-12-05 07:36
    system("mode 45, 20");
    

    This is a bad solution because it disables vertical scrolling.

    This is better:

    system("mode CON: COLS=120");
    
    0 讨论(0)
  • 2020-12-05 07:39

    the

    mode 
    

    and

    system("mode... 
    

    solutions did not work for me and I could not set the layout without getting a access error.

    Fix was to close Cygwin, right click properties on the icon in the start menu and edit layout -> window -> height and then say yes to allowing administrator privileges to save settings. (not run as administrator).

    now when running Cygwin always gives me a large window.

    Windows 7 64bit.

    0 讨论(0)
  • 2020-12-05 07:44

    If you right click on the title bar of a command window and choose properties, you can change widths in the Layout tab

    0 讨论(0)
提交回复
热议问题