2

Is it the expected behaviour that VS Code does not expand variables in its settings?

My example: I need to configure Remote.SSH: Config File to point to a file relative to my home directory. Verbatim values work:

  • C:/Users/myusername/.ssh/config_vs_code
  • C:\Users\myusername\.ssh\config_vs_code

I would certainly expect that variable expansion should work but it does not. These values are not functional:

  • ${userHome}/.ssh/config_vs_code
  • ${env:UserProfile}/.ssh/config_vs_code
  • ${userHome}\.ssh\config_vs_code
  • ${env:UserProfile}\.ssh\config_vs_code

${env:UserProfile} expands correctly in my PowerShell.

Am I doing something wrong? Is there a different way how to use variables in VS Code settings?

1 Answers1

0

Despite that this is an older question, for the sake of completeness: This now works with version 1.79.0 (maybe also earlier) of VS code. At least I was able to successfully use ${env:USERPROFILE) in the settings.json file, running VSC at Windows 10. This seems to be case-insensitive, UserProfile did work, too.

Dr_Be
  • 136