Last active
July 20, 2024 19:31
-
-
Save mpicker0/a6a3f10e6b9278074f93 to your computer and use it in GitHub Desktop.
Configuring IntelliJ's terminal to run Cygwin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
Tools -> Terminal ->Application settings ->Shell Path: "c:\cygwin64\bin\sh.exe" -c "/bin/xhere /bin/bash"
Tools -> Terminal ->Application settings ->Shell Path: "c:\cygwin64\bin\sh" -lic "cd ${OLDPWD-.}; bash"
That last one worked for me in IDEA Ultimate 2018.2
Works for me as well 2018.3.4
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!
Tools -> Terminal ->Application settings ->Shell Path: "c:\cygwin64\bin\sh" -lic "cd ${OLDPWD-.}; bash"
Works like wonder
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
I realize this is a bit of an older solution but I ran into an issue recently where installing chere -i -t mintty caused an issue with intellij setup using this configuration. The terminal will instead begin to start in the /home/user directory. To fix it, I had to comment out the .bashrc lines in this solution for the entire "if" statement including the "cd" statement. I then had to remove the "--login" and "-i" from the bash statement in line 6 of the run_bash.bat script.