-
-
Notifications
You must be signed in to change notification settings - Fork 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
Show OSC8 link URL at bottom of screen on mouse hover #5830
Conversation
This leads to at least the following problems:
When displaying URL addresses, I believe that some common practices to prevent phishing should be used rather than just outputting the original address as is. |
When I was trying to test "URLs that exceed the screen width and height", kitty just crashed. |
I dont think using overlay line is the right way to do this. Instead use Basically, the algorithm would be:
|
Switch step 2 with step 1. This is for the first commit, and after the second commit I think you have resolved it. In any case, if you use this, you want to make sure that at all states, you don't enter a state that is not expected. As kovid said, this is not a proper facility to implement this feature.
I don't quite understand. |
Regarding the display of the URL I suggest you just display it as is. I will take care of sanitizing it to make it useful for phishing detection. |
Sorry,
Would it make sense for me to do the following instead? |
On Wed, Dec 28, 2022 at 12:04:15AM -0800, Yuxin Wu wrote:
Sorry, `render_window_title` looks quite difficult to me as I'm not familiar with glfw.
You dont need to know glfw, just copy paste the existing
render_window_title function changing the use of title_bar_data to a new
url_status_data struct. It will draw at the top of the window with a
direct copy paste, you just need to adjust it to optionally draw at bottom instead depending on cursor position.
> 2. In draw_cells check if the property exists and if so use a function similar to render_window_title to draw the URL
Would it make sense for me to do the following instead?
In `handle_move_event` if a hyperlink is found, use a function similar to `screen_draw_overlay_text` to draw the URL.
The problem with using an overlay line is that, it moves with the text
when things change on screen. So there needs to be a whole
infrastructure to deal with that. That's a lot harder and more fragile
than just drawing the text separately with render_window_title().
Semantically this is basically a tooltip, so it should not be rendered
as part of the screen text, unlike the IME overlay.
|
@kovidgoyal thanks for the guidance. I added |
OK, I will review when I have a moment. |
@ppwwyyxx When the mouse cursor is on top, the URL is still displayed on top, leading to the area pointed by the mouse being covered.
I assume that we are talking about the mouse cursor here. Steps to reproduce:
|
Fix #5827
URL is displayed at bottom by default. If cursor is at the bottom, then URL is displayed at top. Below are screenshots of what it looks like in a terminal with two windows.
Image 1
Image 2