Changed xterm256 formatting to work with Potato. Also added Potato as a TTYPE exception since the client doesn't report itself correctly.

This commit is contained in:
Griatch 2016-08-28 16:36:44 +02:00
parent 9ec875f29c
commit 668029e82e
2 changed files with 6 additions and 2 deletions

View file

@ -137,7 +137,10 @@ class ANSIParser(object):
if use_xterm256:
colval = 16 + (red * 36) + (green * 6) + blue
return "\033[%s8;5;%s%s%sm" % (3 + int(background), colval // 100, (colval % 100) // 10, colval%10)
return "\033[%s8;5;%sm" % (3 + int(background), colval)
# replaced since some cliens (like Potato) does not accept codes with leading zeroes, see issue #1024.
#return "\033[%s8;5;%s%s%sm" % (3 + int(background), colval // 100, (colval % 100) // 10, colval%10)
else:
# xterm256 not supported, convert the rgb value to ansi instead
if red == green == blue and red < 3: