Skip to content

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

Open

Description

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.

Activity

  1. rkeithhill commented on May 31, 2019

    @rkeithhill
    Contributor

    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.

  2. rjmholt commented on May 31, 2019

    @rjmholt
    Contributor

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

    Przemysław Kłys (@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

  3. 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[/+] on May 31, 2019
  4. PrzemyslawKlys commented on May 31, 2019

    @PrzemyslawKlys
    ContributorAuthor

    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.

  5. rjmholt commented on May 31, 2019

    @rjmholt
    Contributor

    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!

  6. rjmholt commented on May 31, 2019

    @rjmholt
    Contributor

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

  7. TylerLeonhardt commented on Jun 2, 2019

    @TylerLeonhardt
    Member

    Daniel Imms (@Tyriar) any thoughts here?

  8. rkeithhill commented on Jun 3, 2019

    @rkeithhill
    Contributor

    Quoting doesn't seem to work. :-(

  9. rjmholt commented on Jun 3, 2019

    @rjmholt
    Contributor

    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

  10. corbob commented on Jun 3, 2019

    @corbob
    Contributor

    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

  11. Bartheleway commented on Oct 16, 2026

    @Bartheleway

    Any news on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions