I did search. I did not find the solution you suggest -- but the solution
from that StackExchange thread also still leaves some control characters.
After passing __fish_vcs_prompt through that sed command and many similar
variants, wc --chars still counts 16 extra characters.
However, the renewed search you inspired led me to discover strip-ansi-cli
<https://github.com/chalk/strip-ansi-cli> NodeJS package. I'm not entirely
sure I want to have a Node dependency for my fish prompt, but strip-ansi
works the way I'd expect, and it's very simple to use...
So, thanks for that.
On Sat, Aug 26, 2017 at 6:02 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:
> On Sat, Aug 26, 2017, at 20:39, Andrew Toskin wrote:
> > In the meanwhile, I've just wasted a few hours trying to `sed` my way
> out of this problem
>
> sed 's/\\x1B\\[[0-9;]*[JKmsu]//g'
> from
> https://unix.stackexchange.com/questions/55546/removing-
> color-codes-from-output
>
> Google prevents wasted hours.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users