讓cygwin不用windows 的cmd來執行命令,改用mintty

TMD

這個windows cmd也太丑了吧,網上找了好久終於找到了辦法


Using mintty for Cygwin and bash (or your preferred shell)

I installed Cygwin with the default options, but did not like how the terminal window was based on the Windows CMD (command line).  I did some reading and found that many people recommend mintty which is based off PuTTY v0.60, arguably a better terminal interface.

However once you install mintty, you don't automatically get your shell.  Running mintty from the Start menu or shortcut icons just dropped me into the /usr/bin directory with limited shell functionality (couldn't do ls, etc. but could do cd).  Weird.  The way to get this right is to edit the C:\Cygwin\cygwin.bat file from Windows, remove or comment out the default shell call, for example:
@echo off
C:
chdir C:\cygwin\bin
REM bash --login -i
start mintty.exe c:\cygwin\bin\bash --login -i

You also might want to look into other startup options such as sizing of the window; you have different options  like:

start mintty.exe -s 120,60 c:\cygwin\bin\bash --login -i           [opens a mintty window with 120 cols, 60 rows in size]

start mintty.exe -w max c:\cygwin\bin\bash --login -i           [opens a mintty window Maximized on your desktop]

Check out some other tips on using mintty:

Tips - mintty - Tips on setting up mintty and related programs


mintty usage and arguments:


Usage: mintty [OPTION]... [ PROGRAM [ARG]... | - ]


Start a new terminal session running the specified program or the user's shell.
If a dash is given instead of a program, invoke the shell as a login shell.


Options:
  -e, --exec            Treat remaining arguments as the command to execute
  -p, --position X,Y    Open window at specified coordinates
  -s, --size COLS,ROWS  Set screen size in characters
  -w, --window normal|min|max|full  Set initial window state
  -t, --title TITLE     Set window title (default: the invoked command)
      --class CLASS     Set window class name (default: mintty)
  -i, --icon FILE[,IX]  Load window icon from file, optionally with index
  -l, --log FILE        Log output to file
  -u, --utmp            Create a utmp entry
  -h, --hold never|always|error  Keep window open after command terminates?
  -c, --config FILE     Load specified config file
  -o, --option OPT=VAL  Override config file option with given value
  -H, --help            Display help and exit
  -V, --version         Print version information and exit


轉載自http://googlebought.blogspot.com/2011/03/using-mintty-for-cygwin-and-bash-or.html

感謝原作者

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值