-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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 opening links in the terminal relative to the actual cwd (not initial) #122617
Comments
(Experimental duplicate detection) |
We can fetch the cwd now for the terminals but only on macOS or Linux, not Windows. |
The updated title somewhat changes from the original description, although it can still be helpful. You're suggesting to check current terminal's CWD, my thought was for the file search to be more flexible about the input path relative to the ws root, meaning it could process the b/c/d.txt path in the example if root is /a/b/ |
I tried reproducing this in macOS (big sur 11.2.3) but could not (it worked) |
To be sure, the files I'm trying to open are not part of the workspace itself. In case the file you were trying to open was added to the workspace. |
One complication that comes up here is that different sections of the buffer have different cwd, so links could act differently depending on whether you cd'd to another directory or not. We may want to record when the cwd changes against a line and evaluate the links using that. Related: #133084 |
/duplicate #139408 |
Issue Type: Bug
Click to open a file path from terminal doesn't work if the relative path displayed on terminal starts from above workspace root.
Workspace root is /a/b
Our file is located at /a/b/c/d.txt
These paths work if I Alt+Click on them on the terminal :
/a/b/c/d.txt
c/d.txt
d.txt
This path won't work :
b/c/d.txt
It's arguably easy to check the root path and realize that this relative path is starting from a node above.
Use case : My compiler is printing error messages with file paths starting from a higher folder than the one added to the workspace. I can't click to open the error locations due to the path issue above.
VS Code version: Code 1.55.2 (3c4e3df, 2021-04-13T09:35:57.887Z)
OS version: Windows_NT x64 10.0.19042
Remote OS version: Linux x64 4.18.0-147.3.1.el8_1.x86_64
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (23)
(5 theme extensions excluded)
The text was updated successfully, but these errors were encountered: