lolcat
lolcat copied to clipboard
Issue with screen and 256 colours
I have been trying to get lolcat to work with screen, and I've been having issues getting the colours to work correctly, attached is an image showing screen on the left, and no screen on the right. I used the script found here to generate the 256 colours that work at the top of the screen.
Sorry if this isn't a lolcat issue, but any help would be greatly appreciated
No, but I did realise it wasn't an issue with lolcat, screen acts funny with 256 colour, I still don't know why, or how to fix it.
I know it can work, it did on my previous work laptop. For some reason it doesn't on my new one despite copying over the same config/rc files as far as I know. It is indeed definitely a screen issue, not ZSH or Bash or Lolcat. Haven't tried with Tmux yet.
I'll post here if I do find a solution.
@nyaalex I don't think this problem is to do with 256-colour terminals. Your screenshot shows that your terminal is capable of showing all of those colours.
I have encountered this problem myself and have been looking into this and think it's down to an interaction between lolcat
, screen
and the COLORTERM
variable. Terminals can advertise their ability to use 24-bit colour by setting COLORTERM=truecolor
. lolcat
has some specific handling for this which might be the source of the problem.
Here is the an example using a new screen
session in a terminal that sets COLORTERM=truecolor
(iTerm). It doesn't render correctly in 24-bit mode but works when I disable that hint.
echo "[$TERM_PROGRAM] [$TERM] [$COLORTERM]"
date | LOLCAT_DEBUG=1 lolcat
date | COLORTERM= LOLCAT_DEBUG=1 lolcat
Here is the an example using a new screen
session in a terminal that doesn't set COLORTERM=truecolor
(macOS terminal). It renders correctly but fails when I enable the 24-bit mode hint.
echo "[$TERM_PROGRAM] [$TERM] [$COLORTERM]"
date | LOLCAT_DEBUG=1 lolcat
date | COLORTERM=truecolor LOLCAT_DEBUG=1 lolcat
Could you please try out unsetting COLORTERM
and see if that works for you?
I will continue to dig around the code to see if I can spot the problem. I'm not a ruby developer though, so I might just end up unsetting COLORTERM
and leaving it there. We'll see.
Oh yeah, you absolutely are right, unsetting COLORTERM fixes it for me too. I said this was not a lolcat issue because this is common to almost every other application that tries to use 24-bit colour with screen, honestly I don't know why that perl script even works. Actually you have been extremely helpful because I never could figure out how to fix them, and unsetting COLORTERM seems like a fixall.
Oh yeah, you absolutely are right, unsetting COLORTERM fixes it for me too
Great to hear!
I said this was not a lolcat issue because this is common to almost every other application that tries to use 24-bit colour with screen
Can't say that I have knowingly used an application that has tried to use 24-bit colour before, but I'll keep an eye out. Having more examples will help with tracking down the source of the problem.
@biggianteye thanks a lot! finally fixed
So the solution is:
$ screen
$ unset COLORTERM
remove -t
flag from the invocation of lolcat
for whatever
$ whatever
?