Using Cygwin’s bash Babun terminal in a JetBrains IDE

Using Cygwin’s bash Babun terminal in a JetBrains IDE
Published:
Aleksandar Stajić
Updated: December 25, 2025 at 08:58 PM

Babun

pwd?

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\etc\bash.bashrcfor 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.