如何创建在特定文件夹中打开Cygwin的Cygwin快捷方式?这样就不用打字了

cd /cygdrive/c/Users/Tom/Desktop/

每次我发射Cygwin。


当前回答

你可以打开cygwin终端,然后写:cd,然后拖放你想要的文件夹,然后进入!

其他回答

将以下代码保存为文件:cygwin_bash.reg

这将同时添加在当前目录中打开Cygwin和在指定文件夹中打开Cygwin。

使用”。Bashrc“而不是”。bash_profile”配置。由于exec bash. .bashrc是为交互式非登录shell执行的。参见:https://apple.stackexchange.com/questions/51036/what-is-the-difference-between-bash-profile-and-bashrc

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\z_cygwin_bash]
@="Cygwin Here"
"Icon"="C:\\cygwin64\\Cygwin.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\z_cygwin_bash\command]
@="C:\\cygwin64\\bin\\mintty.exe /bin/sh -lc 'cd \"`cygpath \"%V\"`\"; exec bash'"

[HKEY_CLASSES_ROOT\Directory\shell\z_cygwin_bash]
@="Cygwin Here"
"Icon"="C:\\cygwin64\\Cygwin.ico"

[HKEY_CLASSES_ROOT\Directory\shell\z_cygwin_bash\command]
@="C:\\cygwin64\\bin\\mintty.exe /bin/sh -lc 'cd \"`cygpath \"%V\"`\"; exec bash'"

在cygwin终端运行如下命令:

回显"cd your_path" >> ~/.bashrc

在打开一个新的bash会话时运行.bashrc脚本。当您打开一个新的cygwin会话时,上面的代码改变了your_path目录。

我使用和图标启动我的cygwin没有chere包。

在我的桌面上为cygwin终端创建一个快捷方式。 右击图标并选择属性。 在快捷选项卡上,对TARGET使用这个: C:\cygwin64\bin\mint .exe -i /Cygwin-Terminal.ico -c 'cd' 对于START IN,将目录/文件夹的路径放在您想要的位置 启动cygwin。例如C: \一些\ dir \名字\

要创建一个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上。

在我的Windows电脑上,它没有显示:

切尔 -i -t 薄荷

因为薄荷shell是不可用的,但你可以选择各种其他shell,如ash bash cmd dash mksh pdksh posh tcsh zsh passwd。

所以我用:

Chere -i -s bash