I am trying to build my custom-commands in Eclipse. This is Eclipse plugin which I am using: https://marketplace.eclipse.org/content/startexplorer
It looks like this (link to image):
I need eclipse variables in custom commands:
${resource_loc} , ${selected_resource_loc} , ${workspace_loc} , etc...
It should be something like this:
D:\cygwin64\bin\mintty.exe /bin/bash -l -c "cd ${workspace_loc}"
But mintty will close this window immediately. I need to execute command based on eclipse variable and go to bash interactive mode, without closing window.
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:
D:\cygwin64\bin\mintty.exe -e /bin/xhere /bin/bash
"${selected_resource_loc}"
yes
Cygwin Bash Here
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:
Cygwin Bash Here
D:\cygwin64\bin\mintty.exe
-e /bin/xhere /bin/bash "${selected_resource_loc}"
Basically, the xhere
script (part of chere
package) performs the following steps:
cd $HOME
(export CHERE_INVOKING=true
, which is checked for in /etc/profile
);cd "$2"
);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
.