Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ctrl+click can not open correct directory? #19

Closed
vinlyx opened this issue Jan 4, 2017 · 15 comments
Closed

Ctrl+click can not open correct directory? #19

vinlyx opened this issue Jan 4, 2017 · 15 comments

Comments

@vinlyx
Copy link

vinlyx commented Jan 4, 2017

When I used ctrl+click to open a folder like /bin, the terminal opened a bin folder in "%LOCALAPPDATA%\wsltty\bin" instead of the real bin folder of WSL ("%LOCALAPPDATA%\lxss\rootfs\bin").
A missing path error would be raised when I tried to open /sbin which doesn't exist in "%LOCALAPPDATA%\wsltty".
It is a bug of wsltty or I need to change some configuration? Thanks!

wsltty version: 0.7.3
Windows version: 14393.576
mintty was launched by "WSL Bash % in Mintty" shortcut.

@mintty
Copy link
Owner

mintty commented Jan 4, 2017

Link-click adaptation for WSL was implemented in mintty 2.7.1 but only for paths outside the WSL root (starting with /mnt). Because the WSL file system is well hidden deep in the user's folders, I assumed the reverse mapping was not desired; also it's slightly more tricky. I'll check.

@vinlyx
Copy link
Author

vinlyx commented Jan 5, 2017

@mintty Thanks for the detailed explanation~! I think the Link-click is one of the best feature of mintty. It will be very convenient if we can have this feature on WSL. Thanks~!

mintty added a commit to mintty/mintty that referenced this issue Jan 6, 2017
mintty added a commit to mintty/mintty that referenced this issue Jan 11, 2017
@mintty
Copy link
Owner

mintty commented Jan 27, 2017

Released 0.7.4.

@mintty mintty closed this as completed Jan 27, 2017
silverwind pushed a commit to silverwind/mintty that referenced this issue Jun 23, 2017
silverwind pushed a commit to silverwind/mintty that referenced this issue Jun 23, 2017
@ghost
Copy link

ghost commented Oct 13, 2017

This is still not working properly in 1.7.9. It can only open files and directories directly under C:\Users<USERNAME>. And it always assume Ctrl-Click is in this directory.

@mintty
Copy link
Owner

mintty commented Oct 14, 2017

Used to work once...

@mintty mintty reopened this Oct 14, 2017
mintty added a commit to mintty/mintty that referenced this issue Oct 14, 2017
@mintty
Copy link
Owner

mintty commented Oct 23, 2017

Released 1.8.0.

@mintty mintty closed this as completed Oct 23, 2017
@ghost
Copy link

ghost commented Oct 25, 2017

Still not working in the newest release. Only work for files under /mnt/c/Users/<user_name>. It doesn't work for sub directories from there.

@mintty mintty reopened this Oct 25, 2017
@mintty
Copy link
Owner

mintty commented Oct 26, 2017

Actually, for me it works. Mind two things:

  • Relative path names work only relative to the start directory as mintty cannot detect the current shell working directory of a WSL shell.
  • Path names with spaces make trouble, and there are many of them below /mnt/c/Users/<user_name>.

If you find an issue that does not match one of these two limitations, please describe it in detail.

@mintty mintty closed this as completed Oct 26, 2017
@ghost
Copy link

ghost commented Oct 27, 2017

Please see screenshots.
capture3
capture
capture1

@mintty
Copy link
Owner

mintty commented Oct 27, 2017

This matches bullet 1 above. You started in C:\Users\Min and the relative pathname is interpreted from there. Mintty has no way to detect that the WSL shell has meanwhile changed into subdirectory test.

This is in fact different from a cygwin shell, for which mintty can detect that because it's running within the same runtime environment.
However, a feature to explicitly set the current working directory for reference is available already (OSC 7 from Mac Terminal); it's currently used with Alt+F2 in cygwin; support for its interaction with WSL can probably be added.

@ghost
Copy link

ghost commented Oct 27, 2017

I see. Thanks a lot for the explanation. Now I understand why it doesn't work. Looking forward to full support of Ctrl-Click in wsltty in the future.

@mintty
Copy link
Owner

mintty commented Oct 31, 2017

Released 1.8.1. Please recheck.

@mintty mintty reopened this Oct 31, 2017
@mintty mintty closed this as completed Oct 31, 2017
@ghost
Copy link

ghost commented Oct 31, 2017

The behavior in the new release 1.8.1 is still the same. But I understand the difficulty of the issue. Thanks a lot for updating this.

@mintty
Copy link
Owner

mintty commented Dec 1, 2017

However, a feature to explicitly set the current working directory for reference is available already (OSC 7 from Mac Terminal); it's currently used with Alt+F2 in cygwin; support for its interaction with WSL can probably be added.

Done.

@mintty
Copy link
Owner

mintty commented Jul 1, 2018

Released 1.9.0. Ctrl+click considers OSC 7.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants