To create a StartExplorer custom command, that opens a Cygwin terminal and
starts an interactive Bash shell in the filesystem location of the selected
resource, follow these steps:
- Make sure to install chere
Cygwin package;
- Install StartExplorer
Eclipse plugin;
- In Eclipse Preferences for plugin StartExplorer, create a new custom
command:
- Command:
D:\cygwin64\bin\mintty.exe -e /bin/xhere /bin/bash
"${selected_resource_loc}"
- Enabled for Resources:
yes
- Name for Resources Menu:
Cygwin Bash Here
- Resource Type:
Folders
Alternatively to steps 2 and 3, if you don't care about context-menu entry, no
need to install the StartExplorer plugin.
Eclipse Extenal Tools Configuration
standard feature will do the trick.
In Run > Extenal Tools Configuration
, create a new Program:
- Name:
Cygwin Bash Here
- Location:
D:\cygwin64\bin\mintty.exe
- Arguments:
-e /bin/xhere /bin/bash "${selected_resource_loc}"
Basically, the xhere
script (part of chere
package) performs the following steps:
- indicate to the login shells not to
cd $HOME
(export CHERE_INVOKING=true
, which is checked for in /etc/profile
);
- change to the directory passed as 2nd argument (
cd "$2"
);
- Execute the shell passed as 1st argument as a login shell (
exec -l $1
).
Note: if you replace /bin/bash
with /etc/passwd
, the current user's login shell read from /etc/passwd
is used instead of bash
.