6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

figを入れたのにコマンドが補完されない

Last updated at Posted at 2023-03-18

概要

  • brewを使ってfigをインストールした。アクセシビリティ系の権限許可なども行いVScodeのターミナルで動作確認したがコマンドがサジェストされないので解決までの道のりを記載する。

問題発生までの経緯

  • 下記コマンドを実行してfigをインストールした。

    brew install fig
    
  • インストール後に表示されるfigのウインドウの指示に従って各種設定を行った。

  • メールアドレスの認証やログインも行った。

問題

  • コマンドが補完されずサジェストタブが表示されない。

問題解決までの経緯

  1. 下記コマンドを実行して解析を試みた。

    fig doctor
    
  2. 下記のエラーが出た。

    PATH contains ~/.local/bin: Path does not contain ~/.local/bin
    
    
    ✘ Doctor found errors. Please fix them and try again.
    
  3. 直訳

    PATH に ~/.local/bin が含まれています: パスに ~/.local/bin が含まれていません
    
    ✘ 医師がエラーを発見しました。 それらを修正して、もう一度お試しください。
    
  4. 必要なものがないっぽい。

  5. エラーで検索したら下記のissueがヒットした。

    1. https://github.com/withfig/fig/issues/1370
  6. 下記コマンドを実行するとレポートが詳しく出るらしいので実行してみる。

    fig doctor --verbose
    
  7. 下記のように出力された。

    $ fig doctor --verbose
    Let's check if you're logged in...
    ✔ Logged into Fig
    
    Let's check your dotfiles...
    ✔ bash ~/.bashrc integration check
    ✔ bash ~/.bash_profile integration check
    ● /Users/shun/.zshrc does not source pre integration
    ● /Users/shun/.zprofile does not source pre integration
    
    Let's make sure Fig is setup correctly...
    ✔ Fig bin exists
    ✘ PATH contains ~/.local/bin: Path does not contain ~/.local/bin
    ✘ PATH contains ~/.fig/bin: Path does not contain ~/.fig/bin
    ✔ Settings Corruption
    ✔ State Corruption
    ✘ Fig Integration: Figterm is not running in this terminal, please try restarting your terminal
    
     FIG_TERM=
    ✘ SSH integration: Integration not installed: /Users/shun/.ssh/config does not exist.
    
      0: Integration not installed: /Users/shun/.ssh/config does not exist.
    
    Location:
      fig_cli/src/cli/doctor.rs:1244
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
    Let's make sure Fig is running...
    ✔ Fig is running
    ✔ Fig socket exists
    ✔ Daemon
    ✔ Daemon diagnostics
    
    Let's see if Fig is in a working state...
    ✘ Figterm: No FIGTERM_SESSION_ID
    
      0: No FIGTERM_SESSION_ID
      1: environment variable not found
    
    Location:
      fig_cli/src/cli/doctor.rs:649
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    ✔ Insertion lock does not exist
    ✔ Autocomplete dev mode
    ✔ Plugin dev mode
    ✔ Dashboard is loading from the correct URL
    ✔ Autocomplete is loading from the correct URL
    
    Let's check if your system is compatible...
    ✔ OS is supported
    ✔ Fish is up to date
    ✔ Jetbrains Toolbox Check
    
    Let's check fig diagnostic...
    ✔ Compatible shell
    ✔ Fig app installed in the right place
    ✔ Autocomplete is enabled
    ✔ Fig CLI path
    ✔ Accessibility enabled
    
    Let's check your terminal integrations...
    ✔ Terminal support
    
    
     Fig still not working? Run fig issue to let us know!
     Or, email us at hello@fig.io!
    
  8. 解決策を書いてくれている人がいた。

    1. https://github.com/withfig/fig/issues/1370#issuecomment-1219265675
  9. ↑の通りやってみる。(ただしviのほうがなれているのでこちらを使う)

    sudo vi /etc/paths
    
  10. 開いたファイルの末尾に下記を追記する。

    /.local/bin
    /.fig/bin
    
  11. 念の為PCを再起動する。

  12. 下記を実行する。

    fig doctor --verbose
    
  13. ちょっとだけエラーが減った。別の部分も解決する必要がある。

    $ fig doctor --verbose
    Let's check if you're logged in...
    ✔ Logged into Fig
    
    Let's check your dotfiles...
    ✔ bash ~/.bashrc integration check
    ✔ bash ~/.bash_profile integration check
    ● /Users/shun/.zshrc does not source pre integration
    ● /Users/shun/.zprofile does not source pre integration
    
    Let's make sure Fig is setup correctly...
    ✔ Fig bin exists
    ✔ PATH contains ~/.local/bin
    ✔ PATH contains ~/.fig/bin
    ✔ Settings Corruption
    ✔ State Corruption
    ✔ Fig Integration
    ✘ SSH integration: Integration not installed: /Users/shun/.ssh/config does not exist.
    
       0: Integration not installed: /Users/shun/.ssh/config does not exist.
    
    Location:
       fig_cli/src/cli/doctor.rs:1244
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
    Let's make sure Fig is running...
    ✔ Fig is running
    ✔ Fig socket exists
    ✔ Daemon
    ✔ Daemon diagnostics
    
    Let's see if Fig is in a working state...
    ✔ Figterm
    ✔ Insertion lock does not exist
    ✔ Autocomplete dev mode
    ✔ Plugin dev mode
    ✔ Dashboard is loading from the correct URL
    ✔ Autocomplete is loading from the correct URL
    
    Let's check if your system is compatible...
    ✔ OS is supported
    ✔ Fish is up to date
    ✔ Jetbrains Toolbox Check
    
    Let's check fig diagnostic...
    ✔ Compatible shell
    ✔ Fig app installed in the right place
    ✔ Autocomplete is enabled
    ✔ Fig CLI path
    ✔ Accessibility enabled
    
    Let's check your terminal integrations...
    ✔ Terminal support
    
    
      Fig still not working? Run fig issue to let us know!
      Or, email us at hello@fig.io!
    
  14. 次に解決すべきエラーは下記である。

    ✘ SSH integration: Integration not installed: /Users/shun/.ssh/config does not exist.
    
       0: Integration not installed: /Users/shun/.ssh/config does not exist.
    
    Location:
       fig_cli/src/cli/doctor.rs:1244
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
  15. 直訳

    ✘ SSHの統合を行いました。統合がインストールされていません。/Users/shun/.ssh/config は存在しません。
    
       0: 統合がインストールされていません。/Users/shun/.ssh/config は存在しません。
    
    場所を指定します。
       fig_cli/src/cli/doctor.rs:1244
    
    バックトレースは省略されています。環境変数RUST_BACKTRACE=1を指定して実行すると表示されます。
    RUST_BACKTRACE=fullで実行すると、ソーススニペットが含まれます。
    
  16. 自身のhomeディレクトリ直下に.sshディレクトリ内にconfigファイルがないらしい。とりあえず/Users/shun/.ssh/直下にからのconfigファイルを設置してみる。

    touch /Users/shun/.ssh/config
    
  17. 下記を実行する。

    fig doctor --verbose
    
  18. ちょっとだけエラーが変わった。

    $ fig doctor --verbose
    Let's check if you're logged in...
    ✔ Logged into Fig
    
    Let's check your dotfiles...
    ✔ bash ~/.bashrc integration check
    ✔ bash ~/.bash_profile integration check
    ● /Users/shun/.zshrc does not source pre integration
    ● /Users/shun/.zprofile does not source pre integration
    
    Let's make sure Fig is setup correctly...
    ✔ Fig bin exists
    ✔ PATH contains ~/.local/bin
    ✔ PATH contains ~/.fig/bin
    ✔ Settings Corruption
    ✔ State Corruption
    ✔ Fig Integration
    ✘ SSH integration: /Users/shun/.fig/ssh does not exist.
    
       0: /Users/shun/.fig/ssh does not exist.
    
    Location:
       fig_cli/src/cli/doctor.rs:1244
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
    Let's make sure Fig is running...
    ✔ Fig is running
    ✔ Fig socket exists
    ✔ Daemon
    ✔ Daemon diagnostics
    
    Let's see if Fig is in a working state...
    ✔ Figterm
    ✔ Insertion lock does not exist
    ✔ Autocomplete dev mode
    ✔ Plugin dev mode
    ✔ Dashboard is loading from the correct URL
    ✔ Autocomplete is loading from the correct URL
    
    Let's check if your system is compatible...
    ✔ OS is supported
    ✔ Fish is up to date
    ✔ Jetbrains Toolbox Check
    
    Let's check fig diagnostic...
    ✔ Compatible shell
    ✔ Fig app installed in the right place
    ✔ Autocomplete is enabled
    ✔ Fig CLI path
    ✔ Accessibility enabled
    
    Let's check your terminal integrations...
    ✔ Terminal support
    
    
      Fig still not working? Run fig issue to let us know!
      Or, email us at hello@fig.io!
    
  19. /Users/shun/.fig/直下にsshファイルがないらしい。つくてみる。

    touch /Users/shun/.fig/ssh
    
  20. 下記を実行する。

    fig doctor --verbose
    
  21. ちょっとだけエラーが変わった。

    $ fig doctor --verbose
    Let's check if you're logged in...
    ✔ Logged into Fig
    
    Let's check your dotfiles...
    ✔ bash ~/.bashrc integration check
    ✔ bash ~/.bash_profile integration check
    ● /Users/shun/.zshrc does not source pre integration
    ● /Users/shun/.zprofile does not source pre integration
    
    Let's make sure Fig is setup correctly...
    ✔ Fig bin exists
    ✔ PATH contains ~/.local/bin
    ✔ PATH contains ~/.fig/bin
    ✔ Settings Corruption
    ✔ State Corruption
    ✔ Fig Integration
    ✘ SSH integration: Improper integration installation: /Users/shun/.fig/ssh should contain:
    Match exec="command -v fig && fig _ generate-ssh %r"
      Include ~/.fig/ssh_inner
    
    
       0: Improper integration installation: /Users/shun/.fig/ssh should contain:
          Match exec="command -v fig && fig _ generate-ssh %r"
            Include ~/.fig/ssh_inner
       0: 
    
    Location:
       fig_cli/src/cli/doctor.rs:1244
    
    Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
    Let's make sure Fig is running...
    ✔ Fig is running
    ✔ Fig socket exists
    ✔ Daemon
    ✔ Daemon diagnostics
    
    Let's see if Fig is in a working state...
    ✔ Figterm
    ✔ Insertion lock does not exist
    ✔ Autocomplete dev mode
    ✔ Plugin dev mode
    ✔ Dashboard is loading from the correct URL
    ✔ Autocomplete is loading from the correct URL
    
    Let's check if your system is compatible...
    ✔ OS is supported
    ✔ Fish is up to date
    ✔ Jetbrains Toolbox Check
    
    Let's check fig diagnostic...
    ✔ Compatible shell
    ✔ Fig app installed in the right place
    ✔ Autocomplete is enabled
    ✔ Fig CLI path
    ✔ Accessibility enabled
    
    Let's check your terminal integrations...
    ✔ Terminal support
    
    
      Fig still not working? Run fig issue to let us know!
      Or, email us at hello@fig.io!
    
  22. うまく統合インストールできてない的なエラーが出ている。

    ✘ SSH integration: Improper integration installation: /Users/shun/.fig/ssh should contain:
    Match exec="command -v fig && fig _ generate-ssh %r"
      Include ~/.fig/ssh_inner
    
    
       0: Improper integration installation: /Users/shun/.fig/ssh should contain:
          Match exec="command -v fig && fig _ generate-ssh %r"
            Include ~/.fig/ssh_inner
    
  23. 直訳

    ✘ SSHの統合。統合のインストールが適切でない。/Users/shun/.fig/ssh が含まれている必要があります。
    マッチ exec="command -v fig && fig _ generate-ssh %r"
      インクルード ~/.fig/ssh_inner
    
    
       0:不適切な統合インストールです。/Users/shun/.fig/ssh が含まれている必要があります。
          マッチ exec="command -v fig && fig _ generate-ssh %r"
            インクルード ~/.fig/ssh_inner
    
  24. 近いことで困っている方がいた。

    1. https://github.com/withfig/fig/issues/2148#issuecomment-1352350670
  25. 下記コマンドを実行してみる。

    fig integrations install ssh
    
  26. 下記のように帰ってきた

    $ fig integrations install ssh
    Installed!
    
  27. 下記を実行する。

    fig doctor --verbose
    
  28. 問題は解決した模様

    $ fig doctor --verbose
    Let's check if you're logged in...
    ✔ Logged into Fig
    
    Let's check your dotfiles...
    ✔ bash ~/.bashrc integration check
    ✔ bash ~/.bash_profile integration check
    ● /Users/shun/.zshrc does not source pre integration
    ● /Users/shun/.zprofile does not source pre integration
    
    Let's make sure Fig is setup correctly...
    ✔ Fig bin exists
    ✔ PATH contains ~/.local/bin
    ✔ PATH contains ~/.fig/bin
    ✔ Settings Corruption
    ✔ State Corruption
    ✔ Fig Integration
    ✔ SSH integration
    
    Let's make sure Fig is running...
    ✔ Fig is running
    ✔ Fig socket exists
    ✔ Daemon
    ✔ Daemon diagnostics
    
    Let's see if Fig is in a working state...
    ✔ Figterm
    ✔ Insertion lock does not exist
    ✔ Autocomplete dev mode
    ✔ Plugin dev mode
    ✔ Dashboard is loading from the correct URL
    ✔ Autocomplete is loading from the correct URL
    
    Let's check if your system is compatible...
    ✔ OS is supported
    ✔ Fish is up to date
    ✔ Jetbrains Toolbox Check
    
    Let's check fig diagnostic...
    ✔ Compatible shell
    ✔ Fig app installed in the right place
    ✔ Autocomplete is enabled
    ✔ Fig CLI path
    ✔ Accessibility enabled
    
    Let's check your terminal integrations...
    ✔ Terminal support
    
    
      Fig still not working? Run fig issue to let us know!
      Or, email us at hello@fig.io!
    
  29. doctorコマンドのオプションなしも実行しておく。

    $ fig doctor
    
    ● /Users/shun/.zshrc does not source pre integration
    ● /Users/shun/.zprofile does not source pre integration
    
    ✔ Everything looks good!
    
      Fig still not working? Run fig issue to let us know!
      Or, email us at hello@fig.io!
    
  30. 問題なさそう。一旦Macそのものを再起動してみる。

  31. Vscodeのターミナルを使って補完を確認してみたところ正常に補完された。

    スクリーンショット_2023-03-18_10_59_08.png

  32. 問題解決

2024/04/11 追記

その後またfigの動作が怪しくなったので「Amazon CodeWhisperer」に乗り換えた↓

参考文献

6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?