-
Notifications
You must be signed in to change notification settings - Fork 39k
Shell integration nonce unavailable in unknown shells and Pseudoterminal-based extension terminals #190253
Copy link
Copy link
Closed
Labels
apiapi-proposalfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesIssue/pull request mentioned in release notesterminal-shell-integrationShell integration infrastructure, command decorations, etc.Shell integration infrastructure, command decorations, etc.verifiedVerification succeededVerification succeeded
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: 1.82.0-insider
- OS Version: Linux x64 6.4.6-1-MANJARO
Steps to Reproduce:
- Create a terminal with a shell that does not officially support shell integration, e.g. Julia.
- Check the value of the
VSCODE_NONCEenvironment variable
When opening a Julia REPL through the extension, the expected warning is shown:
2023-08-10 17:18:24.085 [warning] Shell integration cannot be enabled for executable "/home/pfitzseb/Documents/julia-1.8.5/bin/julia" and args ["-i","--banner=no","--project=/home/pfitzseb/.julia/environments/v1.9","--sysimage=/home/pfitzseb/Documents/Git/sysimgtest/sysimg.so","--project=/home/pfitzseb/Documents/Git/sysimgtest","--threads=auto","/home/pfitzseb/.vscode-insiders/extensions/julialang.language-julia-1.48.1/scripts/terminalserver/terminalserver.jl","/tmp/vsc-jl-repl-901c22ba-51e1-41a7-a1b6-4aacdc696676","/tmp/vsc-jl-cr-54bf6211-7f7f-4cdc-825c-e19c2557ca71","USE_REVISE=false","USE_PLOTPANE=true","USE_PROGRESS=true","ENABLE_SHELL_INTEGRATION=true","DEBUG_MODE=false"]
This happens because the environment variable is only injected if VS Code detects a supported shell (which means that a script for handling shell integration is vendored):
vscode/src/vs/platform/terminal/node/terminalEnvironment.ts
Lines 248 to 250 in 6e2cace
| logService.warn(`Shell integration cannot be enabled for executable "${shellLaunchConfig.executable}" and args`, shellLaunchConfig.args); | |
| return undefined; | |
| } |
An easy solution is to allow extensions to set the nonce in vscode.window.createTerminal (it's then the extension's responsibility to only start shells that properly handle and unset the VSCODE_NONCE env var). Not sure if that holds up to the desired security standards though :)
cc @Tyriar
Reactions are currently unavailable
Metadata
Metadata
Labels
apiapi-proposalfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesIssue/pull request mentioned in release notesterminal-shell-integrationShell integration infrastructure, command decorations, etc.Shell integration infrastructure, command decorations, etc.verifiedVerification succeededVerification succeeded