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

Support path links that contain spaces in the integrated terminal #97941

Closed
nielsvaneck opened this issue May 15, 2020 · 26 comments · Fixed by #169786
Closed

Support path links that contain spaces in the integrated terminal #97941

nielsvaneck opened this issue May 15, 2020 · 26 comments · Fixed by #169786
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan terminal-links
Milestone

Comments

@nielsvaneck
Copy link

nielsvaneck commented May 15, 2020

  • VSCode Version: 1.45.1
  • OS Version: MacOS 10.15.4

Steps to Reproduce:

  1. create a vscode python project in a directory with a space that contains some code that produces a failing test or stacktrace
  2. hover over the paths in the stacktrace and notice that those with a space in a directory name are not rendered as links. those without spaces are.

I have created a tiny repo that reproduces the bug: https://github.com/nielsvaneck/vscode_space_path_bug

Does this issue occur when all extensions are disabled?: Yes

@Tyriar
Copy link
Member

Tyriar commented Jun 11, 2020

For the case that you linked I don't think it's expected that it would be linkified on Linux and macOS when the \ before the space is not present, what tools are outputting this? (it's a little more nuanced on Windows)

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Jun 11, 2020
@nielsvaneck
Copy link
Author

For the case that you linked I don't think it's expected that it would be linkified on Linux and macOS when the \ before the space is not present, what tools are outputting this? (it's a little more nuanced on Windows)

just the error output generated by the python interpreter

@Tyriar Tyriar added feature-request Request for new features or functionality terminal Integrated terminal issues and removed info-needed Issue requires more information from poster labels Jun 12, 2020
@Tyriar Tyriar added this to the Backlog milestone Jun 12, 2020
@smcoll
Copy link

smcoll commented Sep 1, 2020

Am i having the same issue, or is this different?

In the terminal, paths in the Python traceback are not linked/clickable if there is a space in the path, even though the path is quoted. For example:

File "/home/me/some space/myproject/mypapp/models.py", line 360, in foo
    for obj in qs.distinct()

That seems to be the issue referenced by microsoft/vscode-python#7491 (closed and conversation locked) which was moved to #81190 (closed and conversation locked) which is marked as a duplicate of #21125 which is supposedly fixed (closed and conversation locked).

Same problem for traceback inlined in the code editor while debugging (i'm not sure what this UI component is called, or where to find out).

@Tyriar
Copy link
Member

Tyriar commented Sep 2, 2020

@smcoll this is the same issue yes.

As of 1.49.0 we have stabilized the link provider API which would allow Python to add better support to Python-specific link formats like this one. The problem we face is the output could be literally everything, so our list of detection continues to grow and get slower and slower. While we could provide better support for spaces in names (that's what this issue is about), Python could improve the support by making this link do something with foo if that's useful

File "/home/me/some space/myproject/mypapp/models.py", line 360, in foo

And maybe even give this line a link to do something useful:

for obj in qs.distinct()

FYI @luabud

@smcoll
Copy link

smcoll commented Sep 18, 2020

@Tyriar is the line considered Python-specific because it's a format used in Python tracebacks? And are you saying that Python support could choose to link right to that line in the file, for example?

i opened microsoft/vscode-python#7491 hoping that the original issue for the Python extension can be re-opened.

@Tyriar
Copy link
Member

Tyriar commented Sep 18, 2020

@smcoll I commented on microsoft/vscode-python#13989

@jackHedaya
Copy link

I don't think this is python specific –– I'm encountering the same bug in Node.js

@BenjaminGalliot
Copy link

BenjaminGalliot commented Mar 27, 2021

Same here with Julia.

Version : 1.54.3
OS : Linux x64 5.8.0-48-generic snap

@MichaelUray
Copy link

Same problem with Python in Windows 10 using Visual Studio Code (Version: 1.54.3)
It does not allow to click hyperlinks in error messages if there is a space in the path.
2021-03-28_21-52-29_thermalCamVideo py_-thermalCamVideo-_Visual_Stud

@GeorgeLyon
Copy link

This issue also exists with Swift on macOS:
Screen Shot 2021-06-18 at 12 11 41 PM

@ItaiPendler
Copy link

ItaiPendler commented Aug 1, 2021

Hey, this still happens to me, any updates?

@mcurrycl
Copy link

I am also having this issue with Typescript and any other languages I have tried. It makes VSCode unusable for debugging in this sense, I have to manually find the line of code or reinstall Windows to make sure there are no spaces in my linked network and local paths. Please fix.

@specOper99
Copy link

Same here, waiting for a fix :(

@shiraze
Copy link

shiraze commented Nov 1, 2021

Same issue here with any error that get shown in Terminal. Example lint issue, with a path that contains a space ("IS Transfer"), and clicking the link should open up folder location, but attempts to open up "C:\IS" or "Transfer\Source...."
image

@surajmandalcell
Copy link

Any update on this?

@GoodiesHQ
Copy link

For real, you'd think more people would complain since Windows' default account style has a space in the name... any of my documents have a space in the full path.

@bromelio
Copy link

bromelio commented Aug 25, 2022

Same issue with paths in VSC's integrated terminal not being linked/clickable if there is a space in the path (in the file name in my case to be more specific). Would be very handy if it worked to directly jump to compilation errors.

Is there any update on this issue?
And is there a workaround while we wait?

@Tyriar
Copy link
Member

Tyriar commented Aug 25, 2022

@bromelio no updates other than what is posted. A workaround is to select the link (double click + drag makes this easy), copy, then ctrl+p and paste

@bromelio
Copy link

bromelio commented Aug 25, 2022

@Tyriar Thanks for the workaround, very attentive of you! I was hoping for something like replace space with \x20 in your upstream powershell code and it'll work, though 😉. But I guess that's simply not possible then? 😞

Anyway, please have this fixed. It's an annoying bug and I think you personally already found a solution (regex)? If your colleagues don't like regex barring any better idea then please simply tell them that users like bugs even less and push it through regardless. Less important things are constantly being implemented while we've already been patient for over two years here. Maybe we have to get a little more cheeky to be heard, too?

@Pullusb
Copy link

Pullusb commented Oct 10, 2022

Hi everyone,

Same here when developing add-on for blender in VScode.
The installation of Blender folder sadly have a space in name... "Blender Foundation"

Print something like this on error:

    from . import error_handle
  File "C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\myAddon\handle.py", line 176       
    .filename
    ^

I always want to click on that path :rage2: , it even has the line number hint included so it should be able to get there.

+1 for clickable path with space.

For now @Tyriar's workaround save the day (+ we can quickly add line number after path with :258)
But still manual where it should be a one click jump to line.
Does any VScode user here have found a plug-in that parse the console and that could do that ?

Happy coding all

@Tyriar Tyriar changed the title Paths with spaces are not clickable in integrated terminal Support path links that contain spaces in the integrated terminal Dec 7, 2022
@Tyriar Tyriar removed the terminal Integrated terminal issues label Dec 9, 2022
@Tyriar Tyriar modified the milestones: Backlog, January 2023 Dec 21, 2022
@Tyriar
Copy link
Member

Tyriar commented Dec 21, 2022

I put this together in #169786, here are the detected formats when it gets merged:

  • Python style links: From "<path>", line <line>
  • Lines that only contain a path: <path>
  • C++ compiler(?) style errors: <path>(<line>,<col>) :<...>
  • Independently styled file paths: foo<underlined_path>bar

I think that should cover the main cases called out in the issue, let me know if your case isn't covered by this.

@Tyriar Tyriar removed the help wanted Issues identified as good community contribution opportunities label Dec 21, 2022
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Dec 22, 2022
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 23, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan terminal-links
Projects
None yet