Skip to content

Instantly share code, notes, and snippets.

@mpicker0
Last active July 20, 2024 19:31
Show Gist options
  • Save mpicker0/a6a3f10e6b9278074f93 to your computer and use it in GitHub Desktop.
Save mpicker0/a6a3f10e6b9278074f93 to your computer and use it in GitHub Desktop.
Configuring IntelliJ's terminal to run Cygwin
# Add to your .bashrc so the terminal starts in the project directory
if [[ ${INTELLIJ} == "true" ]]; then
cd ${OLDPWD}
fi
# Note that this works in IntelliJ 14, but not in 16.
# Change the shell path in IntelliJ's Tools > Terminal to:
# C:\cygwin64\bin\env INTELLIJ=true TERM=cygwin C:\cygwin64\bin\bash.exe --login -i
@echo off
set INTELLIJ=true
set TERM=vt100
set PATH="C:\cygwin64\bin";%PATH%
bash --login -i
REM This works in IntelliJ 16
REM Change the shell path in IntelliJ's Tools > Terminal to:
REM C:\path\to\this\script\run_bash.bat
@SturmB
Copy link

SturmB commented Jul 29, 2019

Likewise, although I am using PhpStorm 2019.1.
I use zsh, so the command for me is "c:\cygwin64\bin\sh" -lic "cd ${OLDPWD-.}; zsh"
Works perfectly!

@cricketbackground
Copy link

Tools -> Terminal ->Application settings ->Shell Path: "c:\cygwin64\bin\sh" -lic "cd ${OLDPWD-.}; bash"

Works like wonder

@DanKaplanSES
Copy link

DanKaplanSES commented Jul 20, 2024

This worked for me in Intellij IDEA 2024:

C:\cygwin64\bin\bash -ilc 'cd -; exec bash'

The reply above me hung indefinitely.

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