ANSI colors not being displayed

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: ANSI colors not being displayed

Post by SlySven »

Oh, those sequences do look wrong:
Screenshot_20180726_130747.png
The string shown as:
"Lerde[nice] >> \033[38;40;0m\000\000\007�\000\000\002�\033[42;37;1mThe village church\033[38;40;\r"
is wrong IMHO, according to Wikipedia and the original origins of the SGR codes https://www.itu.int/rec/dologin_pub.asp ... type=items indicate that SGR 38 i.e. '\033' followed by '[' followed by "38;" should be followed by a number in the range of '0' to '5' and Mudlet only handles
'5' for the ANSI 256 colour mode and partially handles '2' for 16M colour (24-bit) direct colour codes - there is no way that "40" is a valid value...!

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: ANSI colors not being displayed

Post by SlySven »

Yeah the second replay is riddled with "\033[38;40;0m" entries that seem to be use to "reset" the color except that if it wanted to make things "White on a Black background with no other rendering effects" then they should have used "\033[37;40;0m" or if they just wanted to reset things back to the user's default fore and background - whatever the USER had chosen - they should be sending just "\033[0m" and technically they do not need even that "0" - though it is probably wise to include it.

On the whole I think this is a MUD server configuration issue...

chrio
Posts: 73
Joined: Mon Aug 22, 2016 11:34 am

Re: ANSI colors not being displayed

Post by chrio »

SlySven wrote:
Thu Jul 26, 2018 11:59 am
I am just taking a look at this and will see what I can find - I expect some recent improvement I made to the ANSI SGR code handling has made things much better except for a corner case that is now being hit...
I tested with mudlet 3.0.1 downloaded from the archives and it had the same problem. Perhaps some changes have been made serverside that made it incompatible with mudlet.

On the other hand, ANSI colors works on that mud with the other mudclients I have tried (ZMud/MushClient/Wintin++) and also in Putty, but it may be that they are more forgiving.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: ANSI colors not being displayed

Post by Vadi »

Would you mind reporting the issue to them about the invalid ANSI?

chrio
Posts: 73
Joined: Mon Aug 22, 2016 11:34 am

Re: ANSI colors not being displayed

Post by chrio »

Sorry for the late response, I've been on vacation over the weekend.
Vadi wrote:
Fri Jul 27, 2018 4:42 pm
Would you mind reporting the issue to them about the invalid ANSI?
Sure, I'll try to get in touch with them.

chrio
Posts: 73
Joined: Mon Aug 22, 2016 11:34 am

Re: ANSI colors not being displayed

Post by chrio »

Thanks for the links it was good reading. I took look at it and would like to discuss it some more. I found more on wikipedia https://en.wikipedia.org/wiki/ANSI_esca ... parameters (mostly the same info, but more selective).
SlySven wrote:
Thu Jul 26, 2018 12:24 pm
Oh, those sequences do look wrong:
Screenshot_20180726_130747.png
The string shown as:
"Lerde[nice] >> \033[38;40;0m\000\000\007�\000\000\002�\033[42;37;1mThe village church\033[38;40;\r"
is wrong IMHO, according to Wikipedia and the original origins of the SGR codes https://www.itu.int/rec/dologin_pub.asp ... type=items indicate that SGR 38 i.e. '\033' followed by '[' followed by "38;" should be followed by a number in the range of '0' to '5' and Mudlet only handles
'5' for the ANSI 256 colour mode and partially handles '2' for 16M colour (24-bit) direct colour codes - there is no way that "40" is a valid value...!
As for \033[38;40;0m then yeah, this looks messed up, but shouldn't the following SGR code override it, if it's later in the string? Currently it seems to give up for the remainder of the buffer which seems excessive.

If we take a look at the sequence \033[42;37;1mThe village church this displays bold(1) white text(37) on green background(42) in putty, and this sequence should be correct.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: ANSI colors not being displayed

Post by SlySven »

Trouble is though that the bytes immediately after the broken SGR code is a pair of ASCII NUL (\000 = ASCII code 0) bytes - and those normally indicate the end of the string. That might be why the remainder is disappearing - though I'd have to check to see if that is what would happen...

Mordac
Posts: 1
Joined: Wed Jun 05, 2019 7:06 pm

Re: ANSI colors not being displayed

Post by Mordac »

I am having exactly the same issue as the author of this post.
Upgraded from mudlet 3.0.0-iota to 3.20 and colors work in a way, but the last color overrides all non colors. so it gets very weird.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: ANSI colors not being displayed

Post by Vadi »

It might be a bug in the game like above, can you check?

Post Reply