kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
22.13k stars 907 forks source link

Path hints only copy up to the first space instead of the full path #7362

Closed ArijanJ closed 3 weeks ago

ArijanJ commented 3 weeks ago

Is your feature request related to a problem? Please describe. Path hints use the same selection logic as words as far as I can tell, the only difference is where the hint is displayed. This obviously leads to the full path not being selected for the hint action if it contains spaces: image (the green is what's actually selected)

Describe the solution you'd like The path parser (haven't looked at the implementation, sorry) should continue if it encounters a \ or ignore spaces if the first character in the whole match is a quote.

Describe alternatives you've considered None yet, please feel free to share if anything comes to mind.

Additional context There is some backtracking going on already, so the quotes shouldn't be a problem (there is no / at the beginning of these): image

kovidgoyal commented 3 weeks ago

Lots of tools output paths in contexts where they are separated by spaces. As such the path matching treats space as a boundary. That's not going to change. Fortunately, the hints kitten is completely customizable to the extent that you can write your own matching logic, see its docs.

Although from your description it sounds like you want to match the output of ls, which you can do much more robustly by using ls --hyperlink-auto and using the hints kitten in hyperlink mode with ctrl+shift+p>y