Welcome to the Builder Academy

Question Possible bug in color handling.

More
29 Jan 2026 05:23 #10975 by gbcs
In a previous topic I was given this advice about turning color off.

Colors can be set to default off by changing these lines: github.com/tbamud/tbamud/blob/f6339b495e...src/db.c#L3584-L3585
Having color toggled _off_ means the colors are stripped before being sent to the player.

This advice did work and the command toggle color reports "Your current color level is off."

However, I still have an issue. If I do a command such as "help gold"  the last line has this "␛[0;00m"

I believe that the issue is that the code that strips the colors from a message to a player does not handle the "\tn" that was added to stop color bleed. For example:
/* Also send a \tn - to make color stop bleeding. - Welcor */
send_to_char(d->character, "%s\tn", d->showstr_vector[d->showstr_page]);

Please Log in or Create an account to join the conversation.

More
29 Jan 2026 16:54 - 29 Jan 2026 16:56 #10976 by WhiskyTest
Hi gbcs!

I wasn't able to reproduce this. I use Mudlet normally, but tried on a local telnet terminal too. You mentioned previously connecting via a web browser which could be a factor.

Based on your troubleshooting you could test something like:

modify.c

void show_string()
line 534
Code:
if (d->showstr_page + 1 >= d->showstr_count) {     /* Only append \tn when color is enabled to avoid ANSI leakage */     send_to_char(d->character, "%s%s", d->showstr_vector[d->showstr_page], COLOR_LEV(d->character) >= C_NRM ? "\tn" : "");     free(d->showstr_vector);     ..etc


ps: you'll need to add this to the includes at the top of the file, around line 29 
#include "screen.h" 
Last edit: 29 Jan 2026 16:56 by WhiskyTest.

Please Log in or Create an account to join the conversation.

More
Yesterday 03:24 #10977 by gbcs
First, thanks for the quick reply.

Yes, you are unlikely to see the problem, unless you connect from a social media site that does not support any color or has their own color scheme.

I think your code will fix my issue. Thank you. I will test it and post the result.

Graham

Please Log in or Create an account to join the conversation.

More
Yesterday 06:45 #10978 by gbcs
The code change fixed my issue.

Thanks again.

Graham
The following user(s) said Thank You: WhiskyTest

Please Log in or Create an account to join the conversation.

Time to create page: 0.191 seconds