-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Allow regex based regions to be clickable links #3821
Comments
I'm afraid not, using a regex is very slow, and in your case you would And if you want to use the mouse the correct way is to mark the URLs |
+1 for this feature. It's quite common for companies' internal tools to print short (no schema) urls that only makes sense with internal dns/browser extensions, or even just to save terminal space. Companies I worked for have used patterns like Currently I cannot configure kitty to recognize these regex (unlike alacritty or iTerm2, both support regex). |
Sorry I know this is a super old issue but FWIW this was added to Alacritty. Its fairly handy IMO for the same reason the URL selection is or hyperlinks in general. While it would be nice for every application to support hyperlinks directly its of course, not the case. Even modern applications like Rust which added native hyperlinks support (rust-lang/cargo#12888) only added it for a subset of desirable links, for instance. For example, doing something like opening a file from an compiler error output cannot be done without using To avoid the excess cause, a key modifier could be used. For example, only show matches will Shift is held, etc |
On Mon, May 13, 2024 at 03:07:06PM -0700, John Howard wrote:
To avoid the excess cause, a key modifier could be used. For example, only show matches will Shift is held, etc
That means you need to use the keyboard anyway. At which point what are
you gaining? Using the mouse for this is *much slower* you have to
actually target a particular place, move your mouse exactly there and
click. Using a hint is simply far more efficient.
That said, I will accept a PR that adds the ability to make hints
clickable. Then you can click on a hint with the mouse to select it,
handling your use case of keyboard+mouse for this. At the very least it
will show you just how much worse using a mouse for this is.
|
I had a few minutes, so I implemented making the hints clickable. 8c1e365 Now just do map f1 kitten hints --regex whatever --program - then press f1 and click on whichever match you want and it will be inserted into your command prompt. You can of course change the invocation of the hints to do whatever action you like rather than inserting into the prompt. |
kitty allows clicking regions that look like URLs by manually looking for the pattern:
known-prefix://url-chars
withinmouse.c
.I would like to see this feature expanded to accept any regex based pattern.
I have a script that pipes
git log
output tofzf
. Each line looks like:I'd like to be able to click on
ch12345
to open it within a URL like:https://app.clubhouse.io/story/12345
Describe the solution you'd like
Re implement the URL detection feature to accept one or more regex patterns.
Describe alternatives you've considered
Attempt 1
Make my script detect the
[cC][hH]([0-9]+)
pattern and emit OSC 8 hyperlinks within each line.Though this works just fine with kitty alone, when the script pipes git output to
fzf --ansi
, the latter eats up all hyperlinks as the give option does not go beyond processing ansi escapes.Attempt 2
My next attempt was to add the following line to
kitty.conf
:However, the UX is a bit awkward: rather than simply reaching for the text and clicking it, I have to first double-click to select it and then CTRL+SHIFT+O to open it. (One more keyboard shortcut to remember.)
It would be nice if I could simply reach out and click the
ch12345
text without having to select it first.Attempt 3
Implement the approach as described within the Hints section.
This would work, but is different than the mouse based solution I am trying to come up with.
The text was updated successfully, but these errors were encountered: