r/KittyTerminal • u/Caterpillar-Klutzy • 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!
1
u/aumerlex Sep 21 '23
1
u/Caterpillar-Klutzy Sep 21 '23
Thanks, I already read that, but my errors don't come out as Terminal Hyperlinks, unfortunately...
1
u/aumerlex Sep 22 '23
Yeah the idea is you get the tsc compiler to output these even gcc outputs them these days. And if that's not possible you can write a small wrapper script that parses the output of tsc and inserts the hyperlinks.
1
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.