withfig / fig

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

iTerm and Terminal are very slow since today #1855

Open mvgijssel opened 2 years ago

mvgijssel commented 2 years ago

Sanity checks

Issue Details

Description:

Not sure what changed, but starting today whenever I open a new terminal, new terminal tab or do basic terminal usage it seems to be sluggish either using Terminal or iTerm. When I start a new iTerm session it also looks to be stuck on the fig process. Starting a window this way went from ~1 second to ~30 seconds looking like this:

image

Environment

❯ fig diagnostic

fig-details:
  - desktop-version: Version 1.0.61 (B528) [ABC]
hardware-info:
  - model: MacBook Pro
  - model-id: MacBookPro18,1
  - chip-id: Apple M1 Pro
  - cores: 10 (8 performance and 2 efficiency)
  - mem: 32 GB
os-info:
  - macOS 12.6.0 (21G115)
environment:
  - shell: /opt/homebrew/Cellar/zsh/5.9/bin/zsh
  - terminal: iterm
  - cwd: /Users/maarten/Development/hackerone/data-platform
  - exe-path: /opt/homebrew/bin//fig
  - install-method: brew
  - env-vars:
    - FIG_INTEGRATION_VERSION: 8
    - FIG_TERM: 1
    - FIG_TERM_VERSION: 5.2.0
    - PATH: /opt/homebrew/bin/:/usr/local/bin/:/usr/local/sbin/:/Users/maarten/.local/bin:/Users/maarten/bin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/findutils/libexec/gnubin:/opt/homebrew/opt/gnu-indent/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/gnu-which/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/Users/maarten/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/Library/Apple/usr/bin:/Users/maarten/.fig/bin:/Users/maarten/.local/bin:
    - SHELL: /opt/homebrew/bin/zsh
    - TERM: xterm-256color
    - TERM_SESSION_ID: w0t0p1:38A4F730-6444-43A9-A224-9D3B89921D7F
    - FIG_PID: 6970
- integrations:
  - SSH: false
  - TMUX: false
  - iTerm: installed!
  - Hyper: application is not present.
  - Visual Studio Code: installed!
  - Docker: true
mschrage commented 2 years ago

Very strange. Have you added anything to your Dotfiles in Fig?

mvgijssel commented 2 years ago

Very strange. Have you added anything to your Dotfiles in Fig?

Yes! Just some basic environment variables and aliases.

mvgijssel commented 2 years ago
image

these are my installed plugins

image
mvgijssel commented 2 years ago

Interestingly enough if I disable all the plugins and run fig source the terminal isn't actually updated 🤔. Killing the terminal and opening a new one also doesn't seem to help. For example if I disable the Pure prompt, it still shows up after sourcing and restarting the terminal.

mvgijssel commented 2 years ago

Also validated that if I remove the following statements from .zshrc and .zprofile both iTerm and Terminal are back to normal working condition

# .zprofile
[[ -f "$HOME/.fig/shell/zprofile.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zprofile.pre.zsh"

[[ -f "$HOME/.fig/shell/zprofile.post.zsh" ]] && builtin source "$HOME/.fig/shell/zprofile.post.zsh"
# .zshrc

[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"

[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"
mvgijssel commented 2 years ago

Running the "Uninstall Fig" script and re-installing also doesn't help, still remains painfully slow.

mvgijssel commented 2 years ago

Changing ~/.zshrc and ~/.zprofile to be actual files instead of symlinks also didn't help.

mvgijssel commented 2 years ago

Using the Fig UI is also pretty sluggish, not sure if that is related to this problem. Though because it feels like the problem started happening out of the blue and the way it is slow, it might suggest that Fig is doing blocking outbound calls.

honsq90 commented 2 years ago

I am running into the same issue too, opening and closing tabs in iTerm gave me a rainbow wheel for about 10 seconds or so.

One thing I did notice is that it happens when opening tabs where the initial tab had quite a bit of history (from yarn install logs, git clones, creating/removing directories). I have iTerm set up to maintain the login session when opening tabs, so it stays in the current folder when I split the terminal etc.

After closing all my tabs and opening fresh ones, it seems to have resolved itself.

Hopefully that info helps you narrow down the issue

mschrage commented 2 years ago

Hey @mvgijssel, sorry about the inconvenience here.

Can you run this command to disable any Dotfiles blocks or plugins from being sourced in new terminal sessions and see if the issue goes away?

fig _ local-state dotfiles.enabled false

Also by chance have you started using BlockBlock? I just was on a debugging call with a user who reported slow terminal startup times and this was the culprit.

mvgijssel commented 1 year ago

Hey @mvgijssel, sorry about the inconvenience here.

Can you run this command to disable any Dotfiles blocks or plugins from being sourced in new terminal sessions and see if the issue goes away?

fig _ local-state dotfiles.enabled false

Also by chance have you started using BlockBlock? I just was on a debugging call with a user who reported slow terminal startup times and this was the culprit.

Sorry for the late reply! But running that statement made performance even worse 😅. I'm not using BlockBlock as far as I know!

yuzhanglong commented 1 year ago

Same problem😭 Does anyone have a solution?

syn2ed commented 1 year ago

same issue here

mvgijssel commented 1 year ago

Updated Fig and macOS to the latest version

❯ fig version
fig_cli 2.7.9
❯ sw_vers
ProductName:        macOS
ProductVersion:     13.0.1
BuildVersion:       22A400

But unfortunately this did not resolve it, maybe even made it a little bit slower 😅.