IT박스

Windows cmd.exe가 80 자로 제한되는 이유는 무엇입니까?

itboxs 2020. 8. 17. 08:30
반응형

Windows cmd.exe가 80 자로 제한되는 이유는 무엇입니까?


나는 유닉스에서 터미널을 늘리는 것을 좋아합니다. Windows 절름발이 명령 줄의 역사 또는 이유는 무엇입니까?


그렇지 않습니다. 제목 표시 줄을 마우스 오른쪽 버튼으로 클릭하고 속성을 선택하고 "레이아웃"탭에서 화면 버퍼 크기 (라인 너비 및 스크롤 백)와 창 크기 (뷰포트 크기)를 변경할 수 있습니다. 바로 가기에서 cmd를 시작한 경우 이후 세션을 위해 이러한 설정을 저장할 수 있습니다.


마우스를 싫어하는 사람이라면 cmd 창에 다음을 입력 할 수도 있습니다.

mode <cols>,<lines>
mode 80,25
mode 120,50
etc.

제한되지 않습니다.

  1. cmd.exe 실행
  2. 화면 왼쪽 상단의 아이콘을 클릭합니다.
  3. 속성 선택
  4. 레이아웃 탭을 선택합니다.
  5. 버퍼와 창 너비를 원하는대로 설정하십시오.
  6. 확인 클릭
  7. 나중에 속성 저장 ...을 선택합니다.
  8. 확인을 클릭하십시오.

Console 을 확인하는 것이 좋습니다. 탭 환경에서 여러 셸을 실행할 수있는 오픈 소스 앱입니다. 셸의 알파 투명도를 설정할 수도 있습니다.


RE : MS는 많은 것들에 대해 "역 호환성"을 중요시하기 때문에이 경우 표준 80 와이드 윈도우가 없으면 사람들이 어떻게 든 불안해 할 것이라는 잘못된 믿음이 있다고 생각합니다.

그러나 이전 버전과의 호환성은 매우 끔찍하게 작동합니다. 나는 마이크로 소프트가 그것의 구현에 대해 꽤 철저하다고 생각하지 않는다. 나는 마이크로 소프트가 새로운 버전이 이전 버전에서 작동하지 않도록하는 포스터 소년이라고 믿는다. COMMAND.COM에서는 많은 기능이 제대로 작동하지 않습니다. COMMAND.COM은 일부 프로그램을 제대로 실행하기 위해 DOSONLY를 입력해야한다는 점은 말할 것도없고 유용한 명령을 제거했습니다. 솔직히, 마이크로 소프트가 "역 호환성"을 높이 평가한다고 생각할 수 없습니다.

또한 줄 길이가 80 열 기준 인 진짜 이유는 대부분의 명령 줄 프로그램 등이 사용자가 80 열 프롬프트로 제한된다는 가정하에 작동하기 때문이라고 생각합니다. 즉, 너비를 늘리면 포맷 오류가 발생하거나 프로그램이 완전히 중단 될 수 있습니다.

jmucchiello가 언급했듯이 MODE는 원하는 경우 창 크기를 조정하는 데 잘 작동합니다.

시스템 장치를 구성합니다.

직렬 포트 : 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]

기기 상태 : MODE [기기] [/ STATUS]

인쇄 리디렉션 : MODE LPTn [:] = COMm [:]

코드 페이지 선택 : MODE CON [:] CP SELECT = yyy

코드 페이지 상태 : MODE CON [:] CP [/ STATUS]

표시 모드 : MODE CON [:] [COLS = c] [LINES = n]

유형별 비율 : MODE CON [:] [RATE = r DELAY = d]

그러나 CONFIG.NT에서 DOSONLY를 사용하도록 설정 한 경우 COMMAND.COM을 열면 cmd.exe에서 적절한 DOS 스타일 라인 해상도를 상속하지만 COMMAND.COM 내부에서 MODE를 호출 할 수 없습니다. COMMAND.COM 내에서 크기를 조정하려면 다음과 같이 16 비트 어셈블리 명령을 사용해야합니다.

80x50 라인 해상도 (프레임 버퍼 없음, SVGA 없음, 거의 보편적으로 지원됨)

디버그
A100
MOV AX, 1112
지능 10
지능 20

132x60 라인 해상도 (프레임 버퍼 없음, SVGA 필요. ATI gfx 카드에서 작동하지 않음, 일반적으로 nVidia gfx 카드에서 작동, afaict는 항상 Intel 통합 gfx 카드에서 작동 함)

디버그
A100
MOV AX, 4F02
MOV BX, 010C
지능 10
지능 20

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.


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 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.


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.


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.

See also


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.


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.


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


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.


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.

참고URL : https://stackoverflow.com/questions/319305/why-is-the-windows-cmd-exe-limited-to-80-characters-wide

반응형