cli icon indicating copy to clipboard operation
cli copied to clipboard

`.file` creates links to files that don't exist

Open hadley opened this issue 2 years ago • 5 comments

e.g. cli::cli_inform("{.file doesntexist}")

hadley avatar Mar 08 '23 20:03 hadley

Yeah, that's intentional. Eg with a link to .Rprofile you can create the file if it does not exist. Idk what rstudio does in this case, though.

gaborcsardi avatar Mar 08 '23 20:03 gaborcsardi

It errors when you click on it 😬

hadley avatar Mar 08 '23 21:03 hadley

Yeah, so we could fix this in cli. But I think it would be actually quite useful to "fix" it in the IDE, e.g. for newly created .Renviron and .Rprofile files on Windows, where it is not obvious where they should be.

gaborcsardi avatar Mar 08 '23 21:03 gaborcsardi

But even if it did do something, we need some way in cli to label relative paths that we don't expect to be clickable. It would also be nice to have a different path than what's shown (so you could provide an absolute path but show a relative path), but even then it's useful to have something that doesn't attempt to add the links.

hadley avatar Mar 08 '23 21:03 hadley

Yeah, I left these for "hyperlinks, part two". There are a lot of possibilities, so won't be able to have a good DSL, but we'll have explicit function calls to cover all of them.

gaborcsardi avatar Mar 08 '23 21:03 gaborcsardi