You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a way to take an existing character vector with ANSI control codes and treat it as a cli_ansi_string object. Now I could do this by just setting the class of the vector, but I would prefer using a public function for this. ansi_string seems to have some other encoding logic in it too. Internally it seems that you use ansi_string() to do this. Could this become part of the public API?
The text was updated successfully, but these errors were encountered:
We could do that. The caveat is that cli does not handle all ANSI control codes, and right now ansi_string objects only contain ANSI codes that it supports. If you can mark arbitrary strings as ansi_string objects, then that's not necessarily true any more. But I don't think this is a big danger, so we can do this. Do you want to submit a PR? No pressure at all, just asking. 😄
The caveat is that cli does not handle all ANSI control codes, and right now ansi_string objects only contain ANSI codes that it supports. If you can mark arbitrary strings as ansi_string objects, then that's not necessarily true any more.
I take your point, but even with some missing functionality I think there will still be a better user experience when using an ansi_string object over the character class if it contains any ANSI codes. The big difference is the use of cat to print it out which is a strict improvement. Won't that just delegate the ANSI printing to the user's terminal?
Do you want to submit a PR? No pressure at all, just asking.
I'm looking for a way to take an existing character vector with ANSI control codes and treat it as a
cli_ansi_string
object. Now I could do this by just setting the class of the vector, but I would prefer using a public function for this.ansi_string
seems to have some other encoding logic in it too. Internally it seems that you useansi_string()
to do this. Could this become part of the public API?The text was updated successfully, but these errors were encountered: