withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

PyCharm's terminal issues after update to 1.0.56 #1083

Open Ronserruya opened 2 years ago

Ronserruya commented 2 years ago

Sanity checks

Issue Details

Description:

After the latest update, the Pycharm terminal seems to have a broken behavior

  1. It seems like it doesn't fully source my .bash_profile, after the terminal starts my PS1 prompt is the default, and none of my aliases are defined
  2. Closing the terminal prompts a confirmation window, warning that there is still a process running in that terminal
  3. Before the update, opening the terminal already opened it with my python virtualenv activated, now it doesn't

I noticed this issue #49 and run the commands from this comment https://github.com/withfig/fig/issues/49#issuecomment-1062193423, which made fig work in my terminal but didn't fix any of the previous issues

Might this can help you figure it out:

https://user-images.githubusercontent.com/21235163/157668830-d520e574-6f03-4258-846f-75a409490fa6.mov

If anyone else has this issue, I use this workaround for now: In pycharm's setting make the terminal start with a env variable "BASH_FROM_PYCHARM=true" then change the lines in .bash_profile to

if [ -z $BASH_FROM_PYCHARM ]; then
  export PATH="${PATH}:${HOME}/.local/bin";
  eval "$(fig init bash pre)";
fi;

Environment

Diagnositc from iTERM2:

ron@bash:~$ fig diagnostic
# Fig Diagnostics
## Fig details:
  - Fig version: Version 1.0.56 (B401) [ABC]
  - Bundle path: /Applications/Fig.app
  - Autocomplete: true
  - Settings.json: true
  - Accessibility: true
  - Number of specs: 0
  - Symlinked dotfiles: false
  - Only insert on tab: false
  - Keybindings path:
  - Installation Script: true
  - PseudoTerminal Path: <generated dynamically>
  - SecureKeyboardInput: false
  - SecureKeyboardProcess: <none>
## Hardware Info:
  - Model Name: MacBook Pro
  - Model Identifier: MacBookPro15,1
  - Chip:
  - Cores: 6
  - Memory: 16 GB
## OS Info:
  - macOS 10.15.7 (19H2)
## Environment:
  - User Shell: /usr/local/bin/bash
  - Current Directory: /Users/ron
  - CLI Installed: true
  - Executable Location: /usr/local/bin/fig
  - Current Window ID: 108902/% (com.googlecode.iterm2)
  - Active Process: bash (59485) - /dev/ttys004
  - Installed via Brew: true
  - Environment Variables:
    - FIG_INTEGRATION_VERSION=8
    - TERM_SESSION_ID=w0t1p0:9A3E5749-379D-413C-8582-3AB976439962
    - FIG_TERM=1
    - FIG_TERM_VERSION=4.2.0
    - TERM=xterm-256color
    - PATH=/Users/ron/.sdkman/candidates/java/current/bin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/grep/libexec/gnubin:/Users/ron/.nvm/versions/node/v12.13.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/ron/.local/bin:/Users/ron/.fig/bin:/Users/ron/.local/bin:/Users/ron/Library/Python/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin
    - FIG_CHECKED_PROMPTS=1
## Integrations:
  - SSH: false
  - TMUX: false
  - iTerm: installed!
  - Hyper: application is not present.
  - Visual Studio Code: application is not present.
  - Docker: true

Diagnostic from the broken pycharm terminal:

bash-5.0$ fig diagnostic
# Fig Diagnostics
## Fig details:
  - Fig version: Version 1.0.56 (B401) [ABC]
  - Bundle path: /Applications/Fig.app
  - Autocomplete: true
  - Settings.json: true
  - Accessibility: true
  - Number of specs: 0
  - Symlinked dotfiles: false
  - Only insert on tab: false
  - Keybindings path: 
  - Installation Script: true
  - PseudoTerminal Path: <generated dynamically>
  - SecureKeyboardInput: false
  - SecureKeyboardProcess: <none>
## Hardware Info:
  - Model Name: MacBook Pro
  - Model Identifier: MacBookPro15,1
  - Chip: 
  - Cores: 6
  - Memory: 16 GB
## OS Info:
  - macOS 10.15.7 (19H2)
## Environment:
  - User Shell: /usr/local/bin/bash
  - Current Directory: /Users/ron/Desktop/Projects/contact_enricher
  - CLI Installed: true
  - Executable Location: /usr/local/bin/fig
  - Current Window ID: 108627/% (com.jetbrains.pycharm)
  - Active Process: bash (61082) - /dev/ttys005
  - Installed via Brew: true
  - Environment Variables:
    - FIG_INTEGRATION_VERSION=8
    - TERM_SESSION_ID=5ae8ebf9-dbe6-4390-a1f7-82a721c078eb
    - FIG_TERM=1
    - FIG_TERM_VERSION=4.2.0
    - TERM=xterm-256color
    - PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/ron/.local/bin:/Users/ron/.fig/bin:/Users/ron/.local/bin
    - FIG_CHECKED_PROMPTS=1
## Integrations:
  - SSH: false
  - TMUX: false
  - iTerm: installed!
  - Hyper: application is not present.
  - Visual Studio Code: application is not present.
  - Docker: true


<img width="362" alt="Screen Shot 2022-03-10 at 14 35 48" src="https://user-images.githubusercontent.com/21235163/157669688-d612a9fa-d297-4d14-baf8-aadae5f9c828.png">
thmsrmbld commented 2 years ago

Can also confirm that I can reproduce this too, in basically the exact same conditions.

mschrage commented 2 years ago

I'm investigating this now! @thmsrmbld @Ronserruya

Can you confirm that this only happens in bash?

Ronserruya commented 2 years ago

Thanks @mschrage I tried switching to zsh,
with zsh looks like issue 1 is fixed, it does run the full .zshrc file and all my aliases/env vars are defined
However 2 and 3 are still unfixed, that being said I never used zsh in pycharm before so I can't say if that's a bugged behavior or normal

Weird thing is that even if I comment out the fig lines in .zshrc this behavior continues to happen, and fig continues to work in the terminal

2minchul commented 1 year ago

Is there any news? It still needs to be fixed.

JFox commented 1 year ago

I can confirm that with zsh it happens today exactly as @Ronserruya described and it is a bug from fig that was not happening before

VikalpRusia commented 1 year ago

Any updates?

VikalpRusia commented 1 year ago

@mschrage , @thmsrmbld , @Ronserruya any updates here. It has no updates since a V long time