Interesting, thanks. Looks like this is the open GitHub Issue?
https://github.com/fish-shell/fish-shell/issues/4012
In the meanwhile, I've just wasted a few hours trying to `sed` my way
out of this problem, but haven't had much luck... Trying to only print
[[:graph:]] characters doesn't remove the control characters. And
trying to only remove [[:cntrl:]] characters seems to convert the
control characters to ASCII representations instead, so the
__fish_vcs_prompt string gets a bunch of junk mixed in. I've also
struggled with various combinations of selecting subsets of the raw
__fish_vcs_prompt string, but I'm not getting anywhere useful... If
there's a single regular expression that'll show only the regular
visible characters, I can't figure it out.
Something like a string width command would indeed be handy.

On Sat, 2017-08-26 at 15:56 -0700, Kurtis Rader wrote:
> 
> As you guessed it's almost certainly escape sequences to color the
> output. Run `__fish_vcs_prompt | od -tx1z` to see them. At the moment
> there is no good way to get a count of the displayable characters. I
> opened an issue to propose implementing a `string width` command to
> help with this but it hasn't been implemented yet.
------------------------------------------------------------------------------
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

Reply via email to