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

Make file paths with spaces in the console work as clickable links #1995

Open
PrzemyslawKlys opened this issue May 31, 2019 · 9 comments
Open
Labels
Area-UI Feature: VS Code Request to use or implement a VS Code feature. Issue-Enhancement A feature request (enhancement).

Comments

@PrzemyslawKlys
Copy link
Contributor

System Details

System Details Output


### VSCode version: 1.34.0 a622c65b2c713c890fcf4fbf07cf34049d5fe758 x64

### VSCode extensions:
alefragnani.project-manager@10.5.2
CoenraadS.bracket-pair-colorizer-2@0.0.28
donjayamanne.githistory@0.4.6
DotJoshJohnson.xml@2.4.0
eamodio.gitlens@9.8.1
GitHub.vscode-pull-request-github@0.7.0
HookyQR.beautify@1.5.0
mechatroner.rainbow-csv@1.1.1
monokai.theme-monokai-pro-vscode@1.1.13
ms-vscode.powershell@2019.5.0
PKief.material-icon-theme@3.8.0
pnp.polacode@0.3.2
Shan.code-settings-sync@3.2.9
shd101wyy.markdown-preview-enhanced@0.4.0
WakaTime.vscode-wakatime@2.1.2
yzhang.markdown-all-in-one@2.3.1
Zignd.html-css-class-completion@1.19.0


### PSES version: 1.12.1.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.18362.113
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.113
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When something is broken, and an error is thrown VSCode allows you to ctrl+click link to link to file. This is great, but it doesn't work with the path that has spaces in them.

image

Expected Behaviour

Should work with paths with spaces.

@rjmholt rjmholt added Area-UI Issue-Enhancement A feature request (enhancement). labels May 31, 2019
@rkeithhill
Copy link
Collaborator

I'm not sure this is something the extension controls. It is the VSCode terminal that turns paths into clickable links (not this extension). And the extension doesn't control the generation of that path and the fact that it isn't quoted. It is PowerShell that generates that error text.

@rjmholt
Copy link
Collaborator

rjmholt commented May 31, 2019

Oops, had a comment written out but forgot to post and @rkeithhill's since commented!

@PrzemyslawKlys I'm not sure how we'd change this; these links appear because VSCode automatically turns paths into links (i.e. we don't do anything, it's a native VSCode feature).
The error message itself comes directly from PowerShell too.

If you get rid of the PowerShell extension and replicate the same error in the powershell or pwsh console, you'll see identical behaviour.

Without us intercepting and reformatting the error message in the integrated console (which I imagine might be unwanted by many users and would come at a performance and complexity cost), I'm not sure what we can do here

@rjmholt rjmholt added the Feature: VS Code Request to use or implement a VS Code feature. label May 31, 2019
@rjmholt rjmholt changed the title Clicking on links in console doesn't work for filepaths with spaces Make file paths with spaces in the console work as clickable links May 31, 2019
@PrzemyslawKlys
Copy link
Contributor Author

I figured it might not be something straight forward. If it can't be fixed I can close this issue. It's not a big deal, just something that would be useful in the long run. Maybe a fix to PS6/PS7 so that throwing errors would include path in quotes? Still, older versions of PS would have the problem, but at least new releases would work.

@rjmholt
Copy link
Collaborator

rjmholt commented May 31, 2019

Maybe a fix to PS6/PS7 so that throwing errors would include path in quotes? Still, older versions of PS would have the problem, but at least new releases would work.

Good thinking!

@rjmholt
Copy link
Collaborator

rjmholt commented May 31, 2019

We should investigate how VSCode does this first -- it may be that quoting won't help

@TylerLeonhardt
Copy link
Member

@Tyriar any thoughts here?

@rkeithhill
Copy link
Collaborator

Quoting doesn't seem to work. :-(

@rjmholt
Copy link
Collaborator

rjmholt commented Jun 3, 2019

Quoting doesn't seem to work. :-(

Yeah I had a play around with it and I suspect the link support starts after the quote, where the C:\ or the / occurs

@corbob
Copy link
Contributor

corbob commented Jun 3, 2019

I was going to suggest maybe trying 8.3 naming convention... But... WindowsPowerShell is one of two directories in C:\Program Files that doesn't have 8.3 naming (the other being ModifiableWindowsApps) (also note Windows.old appears to be another one with no 8.3...)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UI Feature: VS Code Request to use or implement a VS Code feature. Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

5 participants