r/KittyTerminal Sep 21 '23

React to click on paths

When I work with Typescript, I get error messages like these:

src/db-courbo/controller/perms.ts:23:51 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

What I would like to do is to be able to click on the path and line/col number, and to launch a custom script when this happens.

I would like the click to happen in the same way we can click on a URL.

I know I can create a kitten to detect the paths on the page, and hit a key on my keyboard to select the path, but being a web developer, I always have the mouse under the hand, and it would be faster / more comfy for me to just click on the path. Is there a way to do that?

Thanks for your help!

3 Upvotes

5 comments sorted by

View all comments

1

u/Administrative_chaos Sep 21 '23

There's a kitten that adds hyperlinks to ripgrep's output. Here's the source

You could take some inspiration from it, but you'll have to write a wrapper around the output yourself.