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

Ctrl-click on url doesn't open it when foreground process cwd is root directory (Regression in 3.7.0) #1254

Closed
jon-turney opened this issue Jan 16, 2024 · 6 comments

Comments

@jon-turney
Copy link

jon-turney commented Jan 16, 2024

Under cygwin, I have a mintty terminal open, running ssh to a linux host, running a screen session, containing weechat.

Ctrl-clicking on a URL in the weechat output used to open it in my browser, but this seems to have stopped working with 3.7.0.

If I copy and paste the URL into another terminal, ctrl-clicking on it opens it, so this seems to be something about the remote session which prevents it from working now

Here's a mintty log of such a session. Clicking on the URL in the last line of the IRC chat doesn't seem to work:
mintty.log

@jon-turney jon-turney changed the title Ctrl-click on url in a remote session doen't open it (Regression in 3.7.0) Ctrl-click on url in a remote session doesn't open it (Regression in 3.7.0) Jan 16, 2024
@mintty
Copy link
Owner

mintty commented Jan 18, 2024

Your log isn't well reproducible. It resizes the window, one URL isn't displayed completely, and it is not clear which URL to click. Anyway, mintty interprets a URL directly from screen contents, it does not have any knowledge whether ssh is active in that moment. The only difference is WSL support mode. Weird.

@jon-turney
Copy link
Author

jon-turney commented Jan 18, 2024

OK, sorry the log isn't much use, but I don't know what extra information to add to make it useful.

The problem affects all URL in my IRC sessions. One other thing to note is that it gets underlined as expected when I ctrl-hover over it, it's just that click does nothing.

I'll see if I can dig into it futher myself, during my copious spare time :)

@mintty
Copy link
Owner

mintty commented Jan 18, 2024

OK, I didn't see you mentioned IRC before but I couldn't reproduce it anyway. Maybe the program adds some hidden characters (like combining characters) or an explicit hyperlink attribute (OSC 8).
Please make a screen log (e.g. mintty -l .logfile.txt) to extract the link, verify you can cat the log and reproduce the issue, then upload it.

@jon-turney
Copy link
Author

I'm sorry. I poked at this a bit more, and discovered that it's nothing to do with a remote session! It's much simpler than that. I just happen to run that session with a working directory of '/'.

This seems to screw up somewhere inside the checking that happens inside guardpath(), since it decides that the URL with "//" prepended is a network path. I don't immediately understand why this is being applied to a URL at all, so I think maybe there is a bug of some sort here.

So, reproduction on cygwin should just be:

$ cd /

$ echo https://cygwin.com
https://cygwin.com

and then try ctrl-clicking on the URL.

@jon-turney jon-turney changed the title Ctrl-click on url in a remote session doesn't open it (Regression in 3.7.0) Ctrl-click on url doesn't open it when foreground process cwd is root directory (Regression in 3.7.0) Feb 8, 2024
@mintty
Copy link
Owner

mintty commented Feb 8, 2024

Thanks for clarifying the report. The issue was already fixed, referring to mintty/wsltty#346.

@mintty
Copy link
Owner

mintty commented Feb 24, 2024

Released 3.7.1.

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

No branches or pull requests

2 participants