Skip to content
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

Some file related variables don't resolve for integrated terminal with JSON file open #78247

Closed
gregvanl opened this issue Jul 31, 2019 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@gregvanl
Copy link

gregvanl commented Jul 31, 2019

  • VSCode Version: 1.37.0 Insiders
  • OS Version: Windows 10

Found will testing #78122

Steps to Reproduce:

Use:

"terminal.integrated.shellArgs.windows": ["/K", "echo", "${file}"],

If you have a Markdown file, you will see the file variable echoed when the terminal is created.
If you open a JSON file, like settings.json, the terminal creation hangs on an empty terminal.

The DevTools output is:

ERR '${file}' can not be resolved. Please open an editor.: Error: '${file}' can not be resolved. Please open an editor.
at u (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2853:268)
at Proxy.evaluateSingleVariable (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2854:533)
at t.replace (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2853:55)
at String.replace ()
at Proxy.resolveString (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2853:10)
at Proxy.recursiveResolve (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2852:716)
at Proxy.resolve (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2851:851)
at Object.t.getDefaultShellArgs (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2782:338)
at Proxy.getDefaultShellAndArgs (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:3549:615)
at y. (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:3962:856)
at Generator.next ()
at file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:35:460
at new Promise ()
at n (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:35:237)
at y._launchProcess (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:3962:253)
at y. (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:3961:221)
at Generator.next ()
at file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:35:460
at new Promise ()
at n (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:35:237)
at y.createProcess (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:3960:356)
at setTimeout (file:///C:/Users/gregvanl/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:3984:268)

Even worse: If you try to close one of the hung terminals, VS Code will hang and you'll get the Reopen/Wait/Close dialog.

@gregvanl
Copy link
Author

This also repros for other file related variables such as:
${relativeFile}
${fileBasename}
${fileBasenameNoExtension}
${fileDirname}
${fileExtname}

@Tyriar
Copy link
Member

Tyriar commented Jul 31, 2019

The resolve call doesn't resolve files when it's the settings files for some reason.

@sandy081
Copy link
Member

sandy081 commented Aug 1, 2019

@isidorn I think this is related to configuration resolver

@isidorn
Copy link
Contributor

isidorn commented Aug 2, 2019

Probably the getFilePath returns undefined for the settings editor or something like that.
Forwarding to @alexr00 as she now owns the resolver service

Also this is not a regression, it always behaved like that for the settings files I believe

@isidorn isidorn assigned alexr00 and unassigned isidorn Aug 2, 2019
@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label Aug 2, 2019
@alexr00 alexr00 added this to the August 2019 milestone Aug 2, 2019
@alexr00
Copy link
Member

alexr00 commented Aug 23, 2019

Repros in Insiders, but not out of source...

@gregvanl gregvanl added the verified Verification succeeded label Aug 27, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants