I love stretching my terminal on unix. What is the history or reason behind windows lame command line?
-
2It's a choice, just like a lot of other things are choices. If you have a fixed size, it's easier to design "your screen" because you exactly know the limits. The disadvantages are obvious, being that whatever size is chosen, it'll always be wrong for somebody or something. The current Windows CMD screen actually WAS the only screen, back in the days. And not many resolutions were available, and very few high-res for that matter. – tvCa Mar 10 '15 at 10:34
14 Answers
It isn't. You can right click the title bar, select properties, and in the "Layout" tab alter the screen buffer size (line width and scrollback) and the window size (viewport size). If you started cmd from a shortcut, you can save these settings for future sessions.

- 265,237
- 58
- 395
- 493
-
2Don't forget font/color. Nothing is as nice as going back to some retro green screens when I open up my command prompt. 8^D – Dillie-O Nov 25 '08 at 23:58
-
13You mean, "nothing other than changing the font to consolas" http://www.hanselman.com/blog/UsingConsolasAsTheWindowsConsoleFont.aspx – Jimmy Dec 17 '08 at 18:08
-
5I always jump in and set the width to 180 and the scrollback to 9999. It's not like you need it very often, but I've never had it hurt anything (even in the days of 128mb machines and the one time you need it, you'll REALLY be glad you set it before hand. The width is a personal preference, I don't like seeing line wraps from my compiler except under extreme conditions, but others don't ever like to scroll. – Bill K Jun 30 '09 at 20:17
-
4Increasing the screen buffer height is very underrated. That kind of scrolling is all too often necessary to be able to fully read a program's output to the screen (unless you use MORE). – Coding With Style Jul 22 '09 at 22:20
-
22Well, yes... but no. You can't arbitrarily resize the window by dragging the window edge and here we are in 2012 and it still hasn't changed. – Alex B Jul 01 '12 at 13:56
-
1Guys look! [The windows console is *finally, actually better* in Windows 10!](https://blogs.windows.com/buildingapps/2014/10/07/console-improvements-in-the-windows-10-technical-preview/) Mouse resizing, line-based selection, shift-key selection, real word wrapping that doesn't insert newlines into your selection... it's finally happened. And about damn time too. (credit to @Diaa in [this SuperUser answer](http://superuser.com/a/958060/178476) for the link) – Ken Bellows Jan 12 '17 at 14:57
If you are mouse-phobic you can also just type this inside the cmd window:
mode <cols>,<lines>
mode 80,25
mode 120,50
etc.

- 18,754
- 7
- 41
- 61
-
11This was super helpful in dealing with a system call to "cmd /c ..." on an app which checks the size of the window for formatting its output. Just tossed a "mode 200,50 && " before the call and life is good – Thomas Feb 01 '11 at 16:17
-
It's not limited.
- Run cmd.exe
- Click on the icon in the upper left hand of the screen.
- Select Properties
- Select the Layout tab.
- Set the buffer and window widths to whatever you like.
- Click OK
- Select Save Properties for future...
- Click OK.
You might want to check out Console. It's an open source app that lets you run multiple shells in a tabbed environment. You can also set the alpha-transparency of the shells.

- 5,350
- 2
- 30
- 45
RE: Because MS value "backwards compatibility" over a lot of things and in this case I suspect it's a misplaced belief that it will somehow unnerve people if they don't have their standard 80 wide window.
The backwards compatibility works pretty terribly, though. I don't imagine Microsoft was pretty thorough about their implementation of it, and I do believe Microsoft is the poster boy for making sure newer versions won't work on older versions. A lot doesn't work properly under COMMAND.COM, which considerably sabotages the usefulness it possesses, not to mention that you have to enter DOSONLY to make some programs run properly, plus Microsoft has been removing useful commands. Honestly, I can't imagine Microsoft holds "backwards compatibility" in much of a high regard.
Furthermore, I think the real reason why the line length is at a standard of 80 columns is because most command-line programs, etc. operate under the assumption that the user is capped at an 80 column prompt, meaning that increasing the width can cause formatting errors or worse possibly break programs altogether.
As jmucchiello mentioned, MODE will work fine for resizing the window if you feel like it.
Configures system devices. Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off] [dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off] Device Status: MODE [device] [/STATUS] Redirect printing: MODE LPTn[:]=COMm[:] Select code page: MODE CON[:] CP SELECT=yyy Code page status: MODE CON[:] CP [/STATUS] Display mode: MODE CON[:] [COLS=c] [LINES=n] Typematic rate: MODE CON[:] [RATE=r DELAY=d]
If you have DOSONLY enabled on your CONFIG.NT, however, when you open COMMAND.COM, it will inherit a proper DOS-style line resolution from cmd.exe, but you cannot invoke MODE from inside COMMAND.COM. If you wish to resize inside COMMAND.COM, you will have to use 16-bit assembly instructions, like so:
80x50 Line Resolution (No framebuffer, no SVGA, virtually universally supported.)
DEBUG A100 MOV AX,1112 INT 10 INT 20 G Q
132x60 Line Resolution (No framebuffer, requires SVGA. Won't work on ATI gfx cards, usually works on nVidia gfx cards, afaict always works on Intel integrated gfx cards.)
DEBUG A100 MOV AX,4F02 MOV BX,010C INT 10 INT 20G Q
If you enter this on your COMMAND.COM, it will give you the specified resolution. (Warning: If your monitor is ancient enough not to support the mode, you might wind up destroying it. Side-note: If you can run Windows, your monitor should be fine. Disclaimer: Emphasis on should, and you've been warned, so it's not my problem if your monitor fries. ;-) However, if you use this without DOSONLY enabled, COMMAND.COM will resize back to its previous size as soon as the application (in this case, unless you wrote it to a file and executed that, DEBUG) exits.
Alternatively, you could use FreeDOS's MODE.COM, which will run properly under COMMAND.COM set to DOSONLY. You can either pull it from the disk image at the official website (freedos.org) or get it at http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/mode/2005/.
New FreeDOS MODE by Eric Auer 2003-2005. License: GPL. (version 12may2005) MODE [device] [/STA[TUS]] (show status of one or all devices) MODE LPTn[:] cols[,[lines][,retry]] (cols or cpi, 6/8 lpi, retry p or n) MODE LPTn[:] [COLS=...] [LINES=...] [RETRY=...] (retry: p infinite / n none) MODE LPTn[:]=[COMn[:]|NUL] (redirect printer data to serial port or NUL) MODE COMn[:] baud,parity,data,stop,retry (empty values allowed) MODE COMn[:] [BAUD[HARD]=...] [PARITY=...] [DATA=...] [STOP=...] [RETRY=...] Baud can be abbreviated to unique prefix, parity can be o/e/n/s/m, the latter 2 mean space/mark, data can be 5..8, stop 1..2. Retry is IGNORED! PLANNED: Retry b/e/r -> busy/error/ready if busy, p/n infinite/no retry. MODE CON[:] [CP|CODEPAGE] [/STA[TUS]] (FreeDOS DISPLAY must be loaded) MODE CON[:] [CP|CODEPAGE] REF[RESH] (needs DISPLAY) MODE CON[:] [CP|CODEPAGE] SEL[ECT]=number (needs DISPLAY) MODE CON[:] [CP|CODEPAGE] PREP[ARE]=((codepage) filename) (needs DISPLAY) Use PREP=((,cp2,cp3,,cp5) ...) to prep codepages in other buffers. MODE [40|80|BW40|BW80|CO40|CO80|MONO][,rows] (rows can be 25, 28, 43 or 50) Use 8, 14 or 16 as 'rows' value if you only want to change the font. MODE [CO40|CO80|...],[R|L][,T] (shift CGA left/right, T is interactive mode) MODE CON[:] [NUMLOCK|CAPSLOCK|SCROLLLOCK|SWITCHAR]=value Value can be: + or - for the locks or a character for switchar. MODE CON[:] [COLS=...] [LINES=...] (possible values depend on your hardware) MODE CON[:] [RATE=...] [DELAY=...] (default rate 20, default delay 1) Rate can be 1..32 for 2..30 char/sec, delay can be 1..4 for 1/4..4/4 sec.
For the same reasons as with the ASM code I provided, unless you execute it in COMMAND.COM with DOSONLY added to your CONFIG.NT file, the window will immediately rebound to its previous size once MODE.COM exits.
Lastly, as others have stated, it is also possible to modify these settings simply by right clicking on the command prompt's title bar, and modifying Properties -> Layout. Similarly, you can set the resolution for any shortcuts to CMD.EXE and batch files (Right click the shortcut -> Properties -> Layout). This only works for CMD.EXE, however, not COMMAND.COM.

- 1,692
- 1
- 14
- 10
A simple command to fix the window size that I use all the time:
wmic
It will open the Windows Management Instrumentation Command-line and remove the size limits. Then just close it with Ctrl+C.
-
-
I found out how to reverse it. Delete the key for cmd.exe under HKCU\Console in the registry. – jocap Dec 30 '21 at 11:20
I don't know the history behind it, but this wishlist item from the author of PuTTy is an interesting post that explains the technical hurdles involved with any type of cmd.exe replacement that isn't lame:
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/win-command-prompt.html
You don't mention that you're looking for a replacement, but if so you might also check out some of the cmd.exe replacements like Console 2 or JP Software's Take Command etc. I've also had some good experiences with PuTTy-Cyg which lets you use PuTTy as a cygwin shell.

- 41,768
- 14
- 66
- 83
While the width is not limited as other answers show, I've always found it strange that one can drag and resize the height with the mouse, but not the width.
I think the default 80 character width is related to compatibility with old programs that assume the terminal won't be more than 80 characters wide. I don't think this has been a realistic reason for a decade or so, though.

- 951,095
- 183
- 1,149
- 1,285
-
9Both the width and the height can be resized, it just happens that the default window width is equal to the buffer width. You cannot make the window larger than the buffer, so the only option (with the default 80-column setting) is to reduce the width. – efotinis Nov 26 '08 at 00:19
As others have pointed out, it's not limited to 80 characters wide, but my guess as to why it defaults to 80 characters would be that it's left over from the DOS days where CRT displays were 80 characters wide.

- 28,540
- 12
- 67
- 94
-
-
you might have to be running with a framebuffer mode to make this work (but I may be wrong, it's been a while.) – andersop Jun 30 '09 at 18:59
-
There are a few SVGA modes that are 132 characters wide without using a framebuffer mode, but they're pretty haphazardly supported. One of those mode is listed in my answer. – Coding With Style Oct 16 '09 at 23:32
-
3It goes back further than that: The reason IBM made its CRT displays 80 columns wide was that its punch cards were 80 columns wide. – dan04 Apr 07 '10 at 04:56
You could also use a different terminal application, such as Console2, which allows you to resize the window all you want (among other things, such as transparency, and the ability to use any font you'd like). It's a great application, I've switched to it and now I only use cmd.exe
when I absolutely have to.

- 127,549
- 26
- 102
- 115
Since it will scroll left to right as well as up and down, the very first thing I do on a system is define my width as 180 and save it. That's generally enough so that stack traces don't have to wrap for the most part, but not so much that you are waisting a ton of space.
While you're at it, set the vertical size (scrollback buffer) to all 9's. You'll be glad you did some day.

- 62,186
- 18
- 105
- 157
Because MS value "backwards compatibility" over a lot of things and in this case I suspect it's a misplaced belief that it will somehow unnerve people if they don't have their standard 80 wide window.
Of course it could be that it was programmed for a fixed 80 chars width when that was pretty much universal, and the additional property settings were a bit of a hack.

- 33,955
- 16
- 77
- 104
It IS limited. Check it out. (I mean window size NOT buffer)
You will find that the maximum width you can set is limited but varies according to your screen resolution. If your resolution is set to 1024 x 768 you will find that you can only get to 128 on the command prompt width. 128/1024=.125
you will find that ratio to be consistent across the board. I have an RDP session running at 2000x768 (across two of my three monitors) and get a max width of 250.
Now, that actaully turns out to be a little bigger than your actaul monitor size but I have three monitors all running individual desktops. (so in essence, 3 1024x768 resolutions) and if I want to do something SO SIMPLE as stretch a command prompt across 2 or more monitors, I CAN'T. (I want to when doing things with very long paths (diruse.exe/etc.)...
-c
-
2If you make your font size smaller, you can get (relatively) bigger window sizes. I just got over 300 wide on a 1600x1200 screen. – Michael Myers Mar 09 '09 at 19:07
-
You can still make your line width bigger and scroll the window. I've made mine 160 or 180 wide since VGA days. – Bill K Jun 30 '09 at 20:19
This isn't closed. So it should be noted that Windows Terminal is now is changing all of this:
https://github.com/microsoft/terminal https://www.theverge.com/2020/1/9/21059316/microsoft-windows-terminal-crt-effects-retro-search-tabs-features https://devblogs.microsoft.com/commandline/windows-command-line-backgrounder/ https://github.com/microsoft/terminal/blob/master/doc/terminal-v1-roadmap.md https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701?activetab=pivot:overviewtab

- 1,598
- 2
- 12
- 14
Because improving the usability and functionality of anything that Unix/GNU-like development requires will undermine Windows as a commercial platform for Microsoft's partners. Preventing this means other large companies' products for developers, such as improved terminals, and other general third party products, like word processors, video players etc. aren't competing with existing Unix/GNU software. Without this, Windows wouldn't be a profitable platform, and Microsoft would lose its desktop monopoly.
This is why the terminal sucks, there's no POSIX API, no C99 support in MSVC and the list goes on. To clarify, common Unix/GNU technologies and development are intentionally unsupported so that large commercial software houses don't have to compete with them.

- 112,946
- 110
- 377
- 526