这是我通过rxvt启动cygwin终端窗口的cygwin.bat文件。
@echo off
C:
set PATH=%PATH%;C:\cygwin\bin
REM SHELL needed for any screen instances started from bash
set SHELL=/bin/bash
set HOME=C:\cygwin\home\Dragos
set HOMEDRIVE=C:
set HOMEPATH=\cygwin\home\Dragos
REM This part is for chere generated context menu item "Open Bash shell here"
REM
if not [%1]==[] (
C:\cygwin\bin\cygpath %1 > tmpFile
set /p startingpath= < tmpFile
del tmpFile
)
if "%startingpath%"=="" C:\cygwin\bin\rxvt --loginShell -sr
if not "%startingpath%"=="" start C:\cygwin\bin\rxvt --loginShell -e /bin/bash --login -c "cd '%startingpath%'; exec /bin/bash -rcfile ~/.bashrc"
exit我想从rxvt切换到mintty,但我不想失去在右击文件夹并选择"Open Bash shell here“时打开cygwin终端cd到该路径的能力。开箱即用的默认mintty命令是
C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -我做到了
man mintty 但我看到的等同于mintty中的rxvt --loginShell -e选项的是--exec。
有没有办法把我喜欢的登录shell (bash)和一些额外的参数传递给mintty,就像我把它们传递给上面的rxvt一样?
发布于 2012-03-10 05:30:32
这是我想出来的。我很有兴趣看看别人有什么作为他们的cygwin.bat
@echo off
C:
set PATH=%PATH%;C:\cygwin\bin
REM SHELL needed for any screen instances started from bash
set SHELL=/bin/bash
set HOME=C:\cygwin\home\Dragos
set HOMEDRIVE=C:
set HOMEPATH=\cygwin\home\Dragos
REM
if not [%1]==[] (
C:\cygwin\bin\cygpath %1 > tmpFile
set /p startingpath= < tmpFile
del tmpFile
)
if "%startingpath%"=="" start C:\cygwin\bin\mintty.exe --icon /Cygwin-Terminal.ico --size 140,50 --exec /bin/bash --login -c "exec /bin/bash -rcfile ~/.bashrc"
if not "%startingpath%"=="" start C:\cygwin\bin\mintty.exe --icon /Cygwin-Terminal.ico --size 140,50 --exec /bin/bash --login -c "cd '%startingpath%'; exec /bin/bash -rcfile ~/.bashrc"
exithttps://stackoverflow.com/questions/9640978
复制相似问题