Skip to content

Instantly share code, notes, and snippets.

@giordanocardillo
Last active February 15, 2017 08:37
Show Gist options
  • Save giordanocardillo/10a6e23e4f9d8b9c5a003333aa2303d7 to your computer and use it in GitHub Desktop.
Save giordanocardillo/10a6e23e4f9d8b9c5a003333aa2303d7 to your computer and use it in GitHub Desktop.
Using Cygwin's bash terminal in a JetBrains IDE

Using Cygwin's (or Babun) bash terminal in a JetBrains IDE

Custom shells in a JetBrains IDE

alt text

Click File then Settings and search for terminal. Change the Shell path to C:\Users\YOUR-USERNAME\.babun\cygwin\bin\bash.exe if you're using Babun. Cygwin users should use C:\cygwin\bin\bash.exe or similar, depending on where you've it installed. Click Ok, open a new terminal (tab) and try running ls -l. Tada!

Working directory?

Hold on... you might notice you're in the wrong directory now. The terminal opened in C:\Users\YOUR-USERNAME\ instead of opening at the root of the current project like it typically would with the default shell. This would drive me mad, especially when switching projects or opening more terminal tabs. To fix this, open up C:\Users\YOUR-USERNAME\.babun\cygwin\home\YOUR-USERNAME\.babunrc for Babun, C:\cygwin\etc\bash.bashrc (or similar) for Cygwin, and add a new line to the end cd $OLDPWD.

Now, you're brought to the current project's room every time you open the terminal or another terminal tab. Great!

Credits

Source: http://engineroom.teamwork.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment