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

Cannot click relative paths in terminal #58256

Closed
StephenHillAtWork opened this issue Sep 8, 2018 · 20 comments
Closed

Cannot click relative paths in terminal #58256

StephenHillAtWork opened this issue Sep 8, 2018 · 20 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release terminal Integrated terminal issues verified Verification succeeded

Comments

@StephenHillAtWork
Copy link

Issue Type: Bug

Run a compiler on a file with an error, and hold down the Alt button and click on the pathname. Nothing happens.

VS Code version: Code 1.27.1 (5944e81, 2018-09-06T09:21:18.328Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)
GPU Status 2d_canvas: unavailable_software
checker_imaging: disabled_off
flash_3d: unavailable_software
flash_stage3d: unavailable_software
flash_stage3d_baseline: unavailable_software
gpu_compositing: unavailable_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled_readback
webgl2: unavailable_off
Memory (System) 31.89GB (23.46GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (15)
Extension Author (truncated) Version
language-x86-64-assembly 13x 2.2.11
rainbow-brackets 2gu 0.0.6
vscode-whitespacer dee 1.0.0
EditorConfig Edi 0.12.4
CppSnippets har 0.0.13
JSDocTagComplete Hoo 0.0.2
MagicPython mag 1.0.12
python ms- 2018.8.0
cpptools ms- 0.18.1
vscode-clearcase Ope 1.12.1
trailing-spaces sha 0.2.11
vscode-hexdump sle 1.6.0
addDocComments ste 0.0.8
python tht 0.2.3
comment-snippets Tob 0.2.0
@vscodebot vscodebot bot added the new release label Sep 8, 2018
@AgainPsychoX
Copy link

AgainPsychoX commented Sep 8, 2018

Same for me, just updated: I was thinking "ok fine update", then there my favorite functionality doesn't work...

URL links seems to work: https://example.org/...
image

..., full path links also: E:/MyFolder/MyFile.cpp...
image

...but relative paths nope:
image

@AgainPsychoX
Copy link

AgainPsychoX commented Sep 8, 2018

Related:

I bet @Tyriar can fix it ;F
Edit: even I can fix it(?)

What is worng?

It looks like there is problem with current working directory:
Full paths are working (i.e. on Windows E:/Some/main.cpp), but relative aren't. There is suspicious looking TODO comment... :C

It really looks like initialCwd is invalid.

There is a function where it is used (to validate path):
https://github.com/Microsoft/vscode/blob/release/1.27/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts#L199

Home path is working, since it doesn't use initialCwd:
image

What is worng with initialCwd? 🤔

How can be it solved?

I see two ways:

A)

B)

I also thinking about just invoking createProcess without (stupid) setTimeout... 🤔

Why I am writing this instead of just fixing it?

I can create some pull request, but later, since it would by mine first PR to VS Code repository, and my first use of TypeScript ;F (I am right now in process of installing contributing environment and cloning the repo XD).

By the way, while reading sources I noticed there is no way to use nice bash paths (/mnt/e/ etc) on Windows, since the path style and home directory are determined by OS which is running VS Code. :C (screen above works because I have Windows/Linux home at same location).

@AgainPsychoX
Copy link

AgainPsychoX commented Sep 8, 2018

I am working on it! Edit: I am stuck :|

There is confirmation that newest version from GitHub repository is also not going very well
image

Edit:
Confirmation, that it was caused by 4ed24e0, but I do know for now how to work around it, since it fixes #48136
Edit 2:
^^^ Not true - commit/issue not related probably. I don't know now why it happend. Sorry for the mess :/

@Tyriar
Copy link
Member

Tyriar commented Sep 8, 2018

@PsychoXIVI wow, nice investigation! @octref noticed links not working but we couldn't repro after that, this being a race condition makes sense as to why we couldn't repro so easily. I've definitely seen it before as well.

A PR would be awesome if you can put it together quick, this might go in the recovery build that we will probably release next week so if you can put a fix together in the next couple of days that would be best.

I think the best and easiest fix here is use TerminalInstance. processReady and set initialCwd on TerminalLinkHandler, and probably remove it from the constructor since it's not very useful there.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues labels Sep 8, 2018
@Tyriar Tyriar added this to the September 2018 milestone Sep 8, 2018
@AgainPsychoX
Copy link

AgainPsychoX commented Sep 8, 2018

After working with it for some time, I can say only that is appears to be randomly (?) bugged.

I will try to use another approach: detecting current working directory of the process form terminal.

Edit: It can't be easily done because of Windows is stupid as fuck and cannot provide simplest API function to read CWD of the process (only availble via raw, cross-process memory access (here AHK code?) :| ). It can be possible for lovely Linux, as always as simple as single shell command: readlink -e /proc/441/cwd. PID can be obtained by onProcessIdReady which is provided node-pty (_process from TerminalProcessManager)

@Tyriar
Copy link
Member

Tyriar commented Sep 9, 2018

@PsychoXIVI we only need the initial cwd to be set to fix this regression. Getting the actual cwd in realtime is another feature which is a bunch of work (mainly because it's tough on Windows currently).

@investment-radar
Copy link

I had the similar issue on Mac OSX, I can not hold the Command and click the relative path.
VScode version: 1.27.1
macOS: 10.13.6

@Tyriar Tyriar added the candidate Issue identified as probable candidate for fixing in the next release label Sep 10, 2018
@Tyriar
Copy link
Member

Tyriar commented Sep 10, 2018

@PsychoXIVI I think I'll put the fix together for this today as it will likely be included in 1.27.2, thanks again for the investigation!

@Tyriar Tyriar changed the title Alt-Click in terminal on pathname now doesn't open file Cannot click relative paths in terminal Sep 10, 2018
Tyriar added a commit that referenced this issue Sep 10, 2018
@Tyriar
Copy link
Member

Tyriar commented Sep 10, 2018

Fixed in master and release/1.27

@Tyriar Tyriar closed this as completed in befd9d2 Sep 10, 2018
@somewhatabstract
Copy link

somewhatabstract commented Sep 10, 2018

Still not working for me after updating to 1.27.1 on macOS NVM, I see this isn't coming till 1.27.2. Saw it in the release notes for 1.27.1 and assumed it should be fixed.

@roblourens roblourens added the verified Verification succeeded label Sep 12, 2018
@szhu
Copy link

szhu commented Sep 13, 2018

Just tried out 1.27.2, the issue still exists. 1.26.x is also broken but 1.25.x works fine.

(macOS 10.13.6)

@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2018

@szhu can you share a screenshot and text of the failing line?

@szhu
Copy link

szhu commented Sep 14, 2018

screen recording 2018-09-14 at 10 47 am

.
./Music
./Music/.localized  ← Recognized
./.gnupg
./.CFUserTextEncoding  ← Recognized
./Pictures
./Pictures/.localized  ← Recognized
./.atom
./.atom/styles.less  ← Recognized
./.atom/.apm
./.atom/.apm/cool-trim
./.atom/.apm/sb-callsite
./.atom/.apm/asap
./.atom/.apm/sb-debounce
./.atom/.apm/disposify
./.atom/.apm/sb-react-table
./.atom/.apm/loose-envify
./.atom/.apm/ms
./.atom/.apm/atom-package-deps

@somewhatabstract
Copy link

I noticed that links that wrap are no longer working. :(

@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2018

@szhu folders never worked. #29499

@somewhatabstract works for me:

screen shot 2018-09-14 at 12 25 41 pm

@somewhatabstract
Copy link

It appears to be linked with resizing.

terminallinks

@Tyriar
Copy link
Member

Tyriar commented Sep 15, 2018

@somewhatabstract that's an unrelated bug that should get fixed with #23688

@b00f
Copy link

b00f commented Sep 19, 2018

It worked for me before, Now it is disabled.

@Tyriar
Copy link
Member

Tyriar commented Sep 19, 2018

@b00f did you update to 1.27.2? Please report a new issue if so.

@b00f
Copy link

b00f commented Sep 21, 2018

@Tyriar Thanks. It is fixed in this version. Hopefully you have integration test for this feature then it won't be an issue in later versions.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 25, 2018
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 candidate Issue identified as probable candidate for fixing in the next release terminal Integrated terminal issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants