0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ClineでShell Integration Unavailableの対処法

Last updated at Posted at 2025-02-04

Clineを触ったときに、なんかエラーが出てエラー対処してくれないなーと思ってましたが、公式ドキュメントの対処をしても解決しなかったので解決策をここに残します。

image.png

原因

Still Having Trouble?の項目において、ps1までのパスに2バイト文字が含まれていることが原因
C:\Users\【ユーザ名】\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1

対処策

短縮名を使って対策しました。

  1. コマンドプロンプトを起動
  2. コマンドプロンプトでdir /x C:\Users を実行し、該当のユーザ名の短縮名をメモる
    e.g.)TAROU~1
  3. コマンドプロンプトでcode $Profileを実行する
  4. 次のコードを貼り付けて保存する
if ($env:TERM_PROGRAM -eq "vscode") { 
    . "C:\Users\【短縮名】\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1"
}

以上
会社のAD管理されてるPCだと二バイト文字の名前が入ってたりしますよね。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?