"Hints" mode to quickly select and act on arbitrary text patterns visible in the terminal #2394
Replies: 6 comments 11 replies
-
On Discord someone mentioned WezTerm also has a "quick select mode" and said:
I figured it would be useful to add a link the corresponding WezTerm docs in this issue - here they are: https://wezfurlong.org/wezterm/quickselect.html I haven't used it myself, but it seems pretty similar to kitty's hints mode. One difference appears to be that the default action is to copy the selection to the clipboard while the action to insert it at the current terminal cursor (i.e. copy and paste the selection, as described in the docs) is achieved by typing the uppercase form of the prefix. In kitty, the --program flag can be configured in more general/flexible ways: in addition to inserting the selection, it can also copy to the clipboard or to a specified buffer, or run the default open program, or launch a specific program in a new kitty tab, window, overlay, etc. That said, I do think WezTerm has the two most common use cases covered. Edit: It also seems like WezTerm matches all of the configured |
Beta Was this translation helpful? Give feedback.
-
The way foot and some other terms implement is to show lables over the links like this: |
Beta Was this translation helpful? Give feedback.
-
Adding my usage here since the rest seem to be about keyboard driven workflows. I use Alacritty currently with mouse hints. How it works is I can just hold shift, and any pattern I hover over becomes underlined. Clicking it does some action - copying it (IPs, UUIDs, etc) or opening it (files in IDE). Config example:
|
Beta Was this translation helpful? Give feedback.
-
Just want to note this appears to also be a feature in I haven't used either of those terminal emulators so I'm not sure exactly how the feature compares to kitty's hints feature. But based on what I saw in those links it seems pretty similar. So a "hints mode" for selecting text patterns seems to be supported in four of the popular terminal editors that other folks are commonly coming to ghostty from (kitty, wezterm, alacritty, iterm2)! (Someone above also mentioned foot terminal but from what I can see in https://codeberg.org/dnkl/foot#urls it seems to be limited to URLs; it doesn't seem like you can add your own regexes to select e.g. git SHAs or file paths. So not quite as flexible/powerful/useful as the others.) |
Beta Was this translation helpful? Give feedback.
-
Chiming in with another use case for kitty's hints. kitty allows you to arbitrarily customize matching and actions tied to hints. I've got it set up to match GitHub PR/issue numbers (like Customization is performed in a python script that's supplied when setting up a binding:
Because something like |
Beta Was this translation helpful? Give feedback.
-
Soooo I realized that maybe I was trying to make ghostty something it wasn’t meant to be. I’ve been back to wezterm for a week now. Ghostty is meant to be the best drop in replacement for the standard terminal in your os, and niche configurations like this one belong elsewhere :) |
Beta Was this translation helpful? Give feedback.
-
This feature has previously been mentioned in #189 - one of the comments there figured that issue would be a prerequisite, but Mitchell confirmed on Discord that it's not. Thus, I'm opening this separate issue for it (encouraged by Mitchell's desire to "hear more use cases/requests"). I personally don't have much need for the search scrollback feature, but I would have a hard time giving up kitty's hints feature.
For those who aren't familiar with kitty's hints feature, the corresponding documentation is at https://sw.kovidgoyal.net/kitty/kittens/hints/ (which also links to its source code). From the intro:
Those are just a couple examples, but through its flexible options you can go further. I don't leverage all the options, but I do use that second example practically on a daily basis, along with the similar
kitty_mod+p>h
shortcut to select a hash, which is very useful when working with git commands. I also usekitty_mod+p>w
to select words, though not quite as often. In addition to the shortcuts for inserting the selection into the terminal at my current cursor position, I also have mappings to copy each of these types of text to the clipboard (so I can paste them in e.g. a GitHub comment, Slack message, etc.).FWIW, here are the relevant quotes from the comments in #189:
@ferdinandyb:
@sluongng:
Beta Was this translation helpful? Give feedback.
All reactions