mstruebing / tldr

Golang command line client for tldr https://github.com/tldr-pages/tldr
MIT License
262 stars 24 forks source link

Foreground color not restored after rendering a page #23

Closed kostix closed 6 years ago

kostix commented 6 years ago

Experiencing at ed5714260dde7dc71ea78e055952603c7c79b710 on Debian Stretch amd64 while running tldr from rxvt-unicode v 9.22 in 256 colors mode, that is, I have

~$ echo $TERM
rxvt-unicode-256color

The bug manifests itself in that the PS1 shell's prompt goes rendered in black color after tldr stack is run. Running reset gets the foreground color back to normal.

Two bits of information which might help:

mstruebing commented 6 years ago

Thank you for reporting these bug. I think this is because of this: https://github.com/mstruebing/tldr/blob/master/render.go#L10-L14 Which are ansi escape sequences if I remember correctly.

kostix commented 6 years ago

I'd add, from looking at this that on my system, executing echo -ne '\033[0m' — as suggested here — resets the terminal colors just like reset does.

kostix commented 6 years ago

Works for me, thanks.