这是我的cygwin.bat文件,用于通过rxvt启动cygwin终端窗口。
@echo off
C:
set PATH=%PATH%;C:cygwinbin
REM SHELL needed for any screen instances started from bash
set SHELL=/bin/bash
set HOME=C:cygwinhomeDragos
set HOMEDRIVE=C:
set HOMEPATH=cygwinhomeDragos
REM This part is for chere generated context menu item "Open Bash shell here"
REM
if not [%1]==[] (
C:cygwinbincygpath %1 > tmpFile
set /p startingpath= < tmpFile
del tmpFile
)
if "%startingpath%"=="" C:cygwinbinrxvt --loginShell -sr
if not "%startingpath%"=="" start C:cygwinbinrxvt --loginShell -e /bin/bash --login -c "cd '%startingpath%'; exec /bin/bash -rcfile ~/.bashrc"
exit
我想从rxvt切换到mintty,但我不想失去在右键单击文件夹并选择"在此处打开Bash shell"时打开指向该路径的cygwin终端的能力。开箱即用的默认mintty命令是
C:cygwinbinmintty.exe -i /Cygwin-Terminal.ico -
我做了
man mintty
但我看到的只是mintty中的rxvt--loginShell-e选项--exec。
有没有一种方法可以像我将首选登录shell(bash)和一些附加参数传递给上面的rxvt一样,将它们传递给mintty?
以下是我的想法。我很想看看其他人的cygwin.bat 是什么
@echo off
C:
set PATH=%PATH%;C:cygwinbin
REM SHELL needed for any screen instances started from bash
set SHELL=/bin/bash
set HOME=C:cygwinhomeDragos
set HOMEDRIVE=C:
set HOMEPATH=cygwinhomeDragos
REM
if not [%1]==[] (
C:cygwinbincygpath %1 > tmpFile
set /p startingpath= < tmpFile
del tmpFile
)
if "%startingpath%"=="" start C:cygwinbinmintty.exe --icon /Cygwin-Terminal.ico --size 140,50 --exec /bin/bash --login -c "exec /bin/bash -rcfile ~/.bashrc"
if not "%startingpath%"=="" start C:cygwinbinmintty.exe --icon /Cygwin-Terminal.ico --size 140,50 --exec /bin/bash --login -c "cd '%startingpath%'; exec /bin/bash -rcfile ~/.bashrc"
exit