1

I'm using Ubuntu 20.10 and VS Code 1.52.1. I followed GitHub's instructions to generate an SSH key, add it to the ssh-agent, and add it to my GitHub account. When I use Ubuntu's built-in Terminal app, everything works correctly for repos that I clone with SSH:

git clone git@github.com:octocat/Spoon-Knife.git
cd Spoon-Knife
git fetch

It doesn't ask for my passphrase every time. Similarly, if I open that cloned repo (or any other) in VS Code and run the Git: Fetch command (or Git: Push etc), it runs successfully without asking for my passphrase.

But when I run git fetch from the same directory inside of the VS Code integrated terminal, I get this message:

Enter passphrase for key '/home/sam/.ssh/id_ed25519':

Even if I enter my passphrase for this invocation, it still keeps asking for my passphrase every time I run git fetch. How can I fix this and make it act like the Ubuntu default terminal? (I saw this question, but it seems to be for the VS Code UI rather than the integrated terminal, and none of the answers worked; most of them were steps that I had already followed as per the GitHub instructions linked above.)

Sam Estep
  • 12,974
  • 2
  • 37
  • 75

1 Answers1

0

Check in your VS Code settings to see if you have Terminal › Integrated: Inherit Env unchecked:

Settings UI with inheritEnv set to false

If it is, re-check it:

Settings UI with inheritEnv set to true

Alternatively, use the Preferences: Open Settings (JSON) command to open your settings file and look for this line:

"terminal.integrated.inheritEnv": false

If it's present, remove it (since true is the default for that setting).

Sam Estep
  • 12,974
  • 2
  • 37
  • 75