我喜欢在unix上拉伸我的终端.windows lame命令行背后的历史或原因是什么?
事实并非如此.您可以右键单击标题栏,选择属性,然后在"布局"选项卡中更改屏幕缓冲区大小(线宽和回滚)和窗口大小(视口大小).如果从快捷方式启动cmd,则可以将这些设置保存以供将来的会话使用.
如果您是鼠标恐惧症,您也可以在cmd窗口中输入:
mode, mode 80,25 mode 120,50 etc.
它没有限制.
运行cmd.exe
单击屏幕左上角的图标.
选择属性
选择"布局"选项卡.
将缓冲区和窗口宽度设置为您喜欢的任何值.
单击确定
选择保存属性以备将来...
单击确定.
您可能想要查看控制台.它是一个开源应用程序,允许您在选项卡式环境中运行多个shell.您还可以设置shell的Alpha透明度.
RE:因为MS对许多事情都有"向后兼容性",在这种情况下,我怀疑如果他们没有标准的80宽窗口会让人感到不安,这是一种错误的信念.
但是,向后兼容性的工作非常糟糕.我不认为微软对它的实现非常彻底,我相信微软是确保新版本无法在旧版本上运行的典型代表.在COMMAND.COM下,很多东西都无法正常工作,这大大破坏了它所拥有的实用性,更不用说你必须输入DOSONLY来使一些程序正常运行,而且微软已经删除了有用的命令.老实说,我无法想象微软会高度重视"向后兼容性".
此外,我认为行长度为80列标准的真正原因是因为大多数命令行程序等在假设用户被限制在80列提示符的情况下运行,这意味着增加宽度会导致格式错误或更糟糕的可能完全打破程序.
正如jmucchiello所提到的,如果您愿意,MODE可以正常调整窗口大小.
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]
如果您在CONFIG.NT上启用了DOSONLY,但是,当您打开COMMAND.COM时,它将从cmd.exe继承正确的DOS样式行分辨率,但您无法从COMMAND.COM内部调用MODE.如果您希望在COMMAND.COM内调整大小,则必须使用16位汇编指令,如下所示:
80x50线路分辨率(无帧缓冲,无SVGA,几乎普遍支持.)
DEBUG A100 MOV AX,1112 INT 10 INT 20 G Q
132x60线路分辨率(无帧缓冲,需要SVGA.不适用于ATI gfx卡,通常适用于nVidia gfx卡,总是适用于英特尔集成gfx卡.)
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.
出于与我提供的ASM代码相同的原因,除非您在COMMAND.COM中将DOSONLY添加到CONFIG.NT文件中执行它,否则一旦MODE.COM退出,窗口将立即反弹到其先前的大小.
最后,正如其他人所说,也可以通过右键单击命令提示符的标题栏并修改属性 - >布局来修改这些设置.同样,您可以为CMD.EXE和批处理文件的任何快捷方式设置分辨率(右键单击快捷方式 - >属性 - >布局).这仅适用于CMD.EXE,但不适用于COMMAND.COM.
一个简单的命令来修复我一直使用的窗口大小:
wmic
它将打开Windows Management Instrumentation命令行并删除大小限制.然后用Ctrl+ 关闭它C.
我不知道它背后的历史,但是来自PuTTy作者的这个愿望清单项目是一个有趣的帖子,它解释了任何类型的cmd.exe替换不涉及的技术障碍:
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/win-command-prompt.html
你没有提到你正在寻找替代品,但如果是这样你也可以查看一些cmd.exe替代品,如Console 2或JP Software的Take Command等.我也有一些很好的PuTTy经验 - Cyg,它允许你使用PuTTy作为cygwin shell.
虽然宽度不受其他答案显示的限制,但我总是觉得很奇怪,人们可以用鼠标拖动和调整高度,但不是宽度.
我认为默认的80字符宽度与旧程序的兼容性有关,假设终端的宽度不超过80个字符.不过,我认为这不是十年左右的现实原因.