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-clicking URLs doesn't always work #1039

Closed
awesomer opened this issue Oct 11, 2020 · 7 comments
Closed

ctrl-clicking URLs doesn't always work #1039

awesomer opened this issue Oct 11, 2020 · 7 comments

Comments

@awesomer
Copy link

awesomer commented Oct 11, 2020

Tested in Environments :

  • Windows 10 : 10.0.19041 Build 19041
  • mintty started with "Cygwin Terminal" start menu shortcut (C:\cygwin64\bin\mintty.exe, which on my system is old version 2.7.9)
  • wsltty (3.3.0) started with "WSL Terminal" shortcut (WSL1)
  • wsltty (3.3.0) running within ConEmu with Conemu "Highlight" turned on
  • wsltty (3.3.0) running within ConEmu with Conemu "Highlight" turned off

Steps to Reproduce :

  1. echo "http://example.com"
  2. ctrl-click on example.com
  3. sometimes, though the URL is underlined, it takes multiple clicks to actually open in the browser. sometimes it doesn't highlight-flash and doesn't open. sometimes it highlight-flashes and doesn't open. other times it opens fine. it doesn't appear to matter where on the URL I click, or how quickly I click. If I click multiple times while holding ctrl, it will eventually open.

This inconsistent behavior is just frustrating enough to be the only significant issue I have ever had with mintty/wsltty. As a long time user of putty/puttycyg/puttytray/conemu, thank you very much for creating and maintaining the best Windows terminal ever.

@mintty
Copy link
Owner

mintty commented Oct 11, 2020

For me, if I Ctrl+hover the mouse over a link and notice its red underlining, subsequent click works reliably.
If I'm fast, there seems to be a glitch if I click quickly before the link gets underlined. However, this may also be caused by a canceled active hovering link, when dragging the mouse. Note that it's actually not the Ctrl+click that opens the link but the Ctrl+mouse-release. If you drag the mouse in between, the opening fails. Please check this out and try to confirm the observation.
If that's the only issue, I may try to tweak the cancelling of the activated link by mouse movement.

@awesomer
Copy link
Author

awesomer commented Oct 11, 2020

I'm pretty confident it's the mouse-movement-while-clicking thing. I have a relatively high DPI setting on my mouse, and am therefore highly likely to slightly move my mouse while clicking. If I consciously focus on not moving my mouse at all while clicking, the failure-to-open rate decreases significantly.

In order to remove any ambiguity as to whether I moved my mouse, I did the following :

  1. Downloaded and installed https://github.com/federicadomani/AutoClicker2-Record-Play-The-Lists-Of-Mouse-Clicks
  2. Set it up with "click at" set to "Fixed Pos," with that position being a place in my terminal there was a url
  3. Set it up to click 10 times with a delay of 2000ms (2 seconds) between each click (to allow for alt-tabbing back to regain focus)
  4. Hit the "start clicking" hotkey and then immediately held Ctrl, alt-tabbing back to the terminal if Chrome managed to gain focus upon opening (which happens ~35% of the time)
  5. Repeatedly verified that there are 10 new open tabs, each containing the page the URL pointed to

This seems like an unambiguous methodology which has verified that mouse movement is the culprit. I am very excited at the prospect of a tweak to this behavior, and hope the above methodology might help you verify such a tweak.

@awesomer
Copy link
Author

Is there a way for me to (build mintty from git and?) drop the mintty.exe into my existing wsltty 3.3.0 install to verify the fix, or is the relationship between mintty and wsltty such that I will have to wait until f56710e is merged into wsltty (or patch it myself and build?)?

@mintty
Copy link
Owner

mintty commented Oct 16, 2020

You can build mintty in a cygwin environment, with additional packages gcc-core and make, and replace the wsltty binary, for testing.

@Biswa96
Copy link
Contributor

Biswa96 commented Oct 16, 2020

Is there a way for me to (build mintty from git and?)

You may setup a CI YAML file which will build mintty for yourself and you don't have to install cygwin, compiler, make, git etc.

@awesomer
Copy link
Author

awesomer commented Oct 16, 2020

I cloned this repo at : commit eddb10f

Within cygwin64, I was able to build a copy of mintty.exe from github master branch. I copied mintty.exe to (after backing up the original wsltty 3.3.0 mintty.exe.

C:\Users\Awesomer\AppData\Local\wsltty\bin

I then launched a shell using the wsltty "WSL Terminal" shortcut, and also tested within ConEmu.

Unfortunately, ctrl-clicking URLs now does not launch them in my system browser at all. I reverted to the original mintty binary, and it still doesn't work. I had to re-install cygwin to build, but AFAIK this shouldn't affect my install of wsltty at all?

I don't understand the mechanism by which this just broke, in a manner I cannot revert from. D'oh.

Edit : apparently restarting my browser was what was needed.

I have now verified the fix. Clicking URLs in wsltty started from "WSL Terminal" shortcut and also within ConEmu now launches the URL in my browser 100% of the time. The subconscious relief I feel going from clicking URLs working 65% of the time to working 100% of the time cannot be overstated. Great success.

Thank you for your excellent support, this whole experience is a shining example of how open source software development should work. 🙌👏

@mintty
Copy link
Owner

mintty commented Oct 24, 2020

Released 3.4.1.

@mintty mintty closed this as completed Oct 24, 2020
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

3 participants