필자는 home directory 에 .bash_profile에 alias를 설정해 놓은 것들이 있다.

예를 들어 아래와 같이 설정해두었기 때문에 해당 alias를 종종 사용하는 편인데,

 

IntelliJ Terminal에서는 사용이 불가능 했다. 

alias opendir='explorer .'
alias gorepo='cd "C:\DEV"'

 

해결 방법 

1. File > Settings > Tools > Terminal 에 shell path에 --login 옵션을 추가한다.
2. File > Settings > Tools > Terminal 에 shell path에 --rcfile ~/.bash_profile 옵션을 추가한다.

 

https://intellij-support.jetbrains.com/hc/en-us/community/posts/205437150-Terminal-not-sourcing-bash-profile?page=1#community_comment_204862230

나와 같은 현상을 겪던 유저가 올려놓은 것인데, (해당 유저는 Pycharm을 사용함)

comment에서 --rcfile ~/.bash_profile 로 하면 된다는 것도 추가로 알 수 있었음.

 

보통 터미널을 열면 interactive 모드로 열리는데, interactive 모드는 

 

사용자가 터미널(또는 콘솔)에서 실시간으로 명령어를 입력하고 그 결과를 즉시 확인할 수 있는 모드입니다.

 

 

근데 intelliJ에서는 non-interactive 모드로 열려서 .bash_profile은 읽지 않고 있었다. 

 

https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

 

Bash Startup Files (Bash Reference Manual)

6.2 Bash Startup Files This section describes how Bash executes its startup files. If any of the files exist but cannot be read, Bash reports an error. Tildes are expanded in filenames as described above under Tilde Expansion (see Tilde Expansion). Interac

www.gnu.org

위의 글을 확인해보면 non-interactive mode에서는 .bashrc 만 읽는다고 한다.

 

따라서 --login 옵션을 주어 나의 custom setting이 들어가져 있는 .bash_profile이 적용되도록 하면 된다.

 

+ Recent posts