-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Special symbols in .env file issue #50302
Comments
This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. Happy Coding! |
Open the issue microsoft/vscode-python#1727 |
@Tyriar , please reopen this issue. As @DonJayamanne said, it is an upstream issue |
@Tyriar const termArgs: DebugProtocol.RunInTerminalRequestArguments = {
kind: consoleKind,
title: 'Python Debug Console',
cwd,
args: [command].concat(commandArgs),
env
};
this.debugSession.runInTerminalRequest(termArgs, 5000, (response) => { So, its VS Code that's not encoding the variables appropriately when setting them in the terminal. |
Oh I see, from this:
It looks like the debugger is sending text to the terminal, it needs to do the proper escaping when doing the |
When you use .env file in the VS Code project and CMD.exe as terminal (
"terminal.integrated.shell.windows": "cmd.exe"
) then for settings environment variables generated commands such ascmd /C "set "SECRET_KEY=uh_p8w$eo6%%tf5)d43b2y))88qxf2t9-s=osvq46u#3ya^p+"
without escaping special symbols. Special symbols (such as&
and^
) in the values of environment variables from the.env
file in theset
command should be escaped with the^
symbol.Steps to Reproduce:
SECRET_KEY=uh_p8w$eo6%%tf5)d43b2y))88qxf2&t9-s=osvq46u#3ya^p+
"envFile": "${workspaceFolder}/.env"
in it (.env file used by default, so may be adding this line is not necessary)In the Terminal the following error appears:
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: