2012-03-09 4 views
0

다음은 rxvt를 통해 cygwin 터미널 창을 시작하기위한 cygwin.bat 파일입니다.cygwin에서 rxvt login batch를 mintty로 변환

@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 

내가 mintty하는 rxvt 전환하고 싶지만 내가 폴더를 마우스 오른쪽 버튼으로 클릭하고 여기에 "열기 배쉬 쉘을 선택할 때 해당 경로에 cd'd Cygwin에서 터미널을 열 수있는 기능을 잃고 싶지 않아 ". 상자 밖으로 기본 mintty 명령은 내가

man mintty 

했다

C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico - 

하지만 모두가 그게 mintty에 -e 옵션이 --exec입니다 rxvt --loginShell하는 것과 동일합니다 참조하십시오.

선호하는 로그인 쉘 (bash)과 일부 추가 매개 변수를 mintty에 전달하는 방법이 있습니까? 위의 rxvt에 전달한 것과 같은 방법입니까?

답변

0

다음은 내가 생각해 낸 것입니다. 나는 그들의 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" 
exit 
+0

mintty에 rxvt에서 전환에 좋은 장점은 당신이 용어 창에서 텍스트를 선택하는 동안 Alt 키를 눌러 원주 선택 할 수 있다는 것입니다으로 무엇을 다른 사람보고 매우 관심이있을 것입니다. –