用mintty作为cygwin的console

  |   Source

UPDATED: <2015-01-31 Sat>

CREATED: <2011-04-29 Fri>

cygwin1.7在我的电脑上不能显示中文,已困扰我很久了.

今天才找到解决办法,只要安装mintty即可.

最新版Cygwin默认就已安装启用mintty.

安装后在宽屏显示器上字可能较小, 解决办法如下:

  • 或参考其手册缩放字体.
  • 或右击左上角设置字体, "新宋体 常规 三号"

另外设置scroll back 80000行. 右侧滚动条无.

以下是我的cygwin.bat,

@echo off
set EDITOR=vi
set VISUAL=vi
REM shamelessly copied from git://github.com/justsoso8/dotfile.git
REM mintty installed which supports chinese
REM =======================================
@echo off
rem find cygwin roo directory one by one
rem disk c -> disk d -> disk e

:CYGWIN_C
if not exist c:\cygwin goto CYGWIN_D
set _cygwinroot=c:\cygwin
goto HAVECYGWIN

:CYGWIN_D
if not exist d:\cygwin goto CYGWIN_E
set _cygwinroot=d:\cygwin
goto HAVECYGWIN

:CYGWIN_E
if not exist c:\cygwin64 goto CYGWIN_F
set _cygwinroot=c:\cygwin64
goto HAVECYGWIN

:CYGWIN_F
if not exist d:\cygwin64 goto NOCYGWIN
set _cygwinroot=d:\cygwin64
goto HAVECYGWIN

:NOCYGWIN
echo no cygwin installation found on disk C/D/E/F
pause
goto EOF

:HAVECYGWIN

chdir %_cygwinroot%\bin
set _termapp=%_cygwinroot%\bin\mintty.exe
start %_termapp% -w full /bin/bash --login -i
:EOF
exit
Comments powered by Disqus