如何创建在特定文件夹中打开Cygwin的Cygwin快捷方式?这样就不用打字了
cd /cygdrive/c/Users/Tom/Desktop/
每次我发射Cygwin。
如何创建在特定文件夹中打开Cygwin的Cygwin快捷方式?这样就不用打字了
cd /cygdrive/c/Users/Tom/Desktop/
每次我发射Cygwin。
当前回答
可能是最简单的一个:
1)创建文件foo.reg
2)插入内容:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\background\shell\open_mintty]
@="open mintty"
[HKEY_CLASSES_ROOT\Directory\background\shell\open_mintty\command]
@="cmd /C mintty"
3)执行foo.reg
现在只需右键单击任何文件夹,单击打开mintty,它将在该文件夹中生成mintty。
其他回答
以管理员身份打开Cygwin终端
在powershell中(使用巧克力):
choco install cyg-get
在cygwin 将安装右键菜单
cyg-get install chere
chere -i
现在您可以在任何文件夹中单击右键并使用“Bash Prompt Here”。
我已经做了一个注册表编辑脚本打开Cygwin在任何文件夹你右键单击。在我的GitHub上。
这是我的GitHub
来自Github的64位机器RegEdit示例代码:
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\CygwinHere]
@="&Cygwin Bash Here"
[HKEY_CLASSES_ROOT\Directory\shell\CygwinHere\command]
@="C:\\cygwin64\\bin\\mintty.exe -i /Cygwin-Terminal.ico C:\\cygwin64\\bin\\bash.exe --login -c \"cd \\\"%V\\\" ; exec bash -rcfile ~/.bashrc\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\CygwinHere]
@="&Cygwin Bash Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\CygwinHere\command]
@="C:\\cygwin64\\bin\\mintty.exe -i /Cygwin-Terminal.ico C:\\cygwin64\\bin\\bash.exe --login -c \"cd \\\"%V\\\" ; exec bash -rcfile ~/.bashrc\""
你可以打开cygwin终端,然后写:cd,然后拖放你想要的文件夹,然后进入!
在我的Windows电脑上,它没有显示:
切尔 -i -t 薄荷
因为薄荷shell是不可用的,但你可以选择各种其他shell,如ash bash cmd dash mksh pdksh posh tcsh zsh passwd。
所以我用:
Chere -i -s bash
要创建一个Windows快捷方式,在您自己选择的目录中启动Cygwin终端,请尝试以下操作:
Right-click on the Windows desktop, select 'New', and then select 'Shortcut'. For location of the item, enter the following text, changing the mintty path as needed and substituting the name of the desired directory where indicated. C:\cygwin64\bin\mintty.exe /bin/sh -lc 'cd DESIRED-DIRECTORY; exec bash' For example, the OP would use the following text: C:\cygwin64\bin\mintty.exe /bin/sh -lc 'cd /cygdrive/c/Users/Tom/Desktop/; exec bash' Click 'Next'. Enter the desired name for the shortcut and click 'Finish'.
可以在桌面上放置多个快捷方式,在各种经常访问的目录中打开Cygwin终端。
灵感来自解决方案张贴如何打开一个Cygwin shell在一个特定的目录从Netbeans?在superuser.com上。