mintty是windows下最好的命令行
如果你想从其他地方(比如Total Commander)运行Mintty(cygwin,或者msys),并进入到当前目录,你需要修改home目录下的.bash_profile(没有这文件的话自己新建),并添加以下内容
If you want to run Mintty (cygwin) from Total Commander starting it into the current work directory, then add the following lines to your .bash_profile:
if [ “$STARTDIR” != “” ]; then
[ “${STARTDIR:0:1}” == ‘\’ ] && STARTDIR=”\${STARTDIR}”
cd “$(echo $STARTDIR | sed ‘s:\:/:g’)”
fi
在Total Commander里的使用方法
And in Total Commander use the following:
Command: c:\cygwin\bin\mintty.exe
Parameters: -e /bin/bash -c "export STARTDIR='%P' ; /bin/bash --login -i"