scandum / tintin

TinTin++, aka tt++, is an extensible console MUD client.
https://tintin.mudhalla.net
GNU General Public License v3.0
201 stars 56 forks source link

The `%W` width calculation standard and `%-30s` seem to be inconsistent #164

Closed dzpao closed 1 year ago

dzpao commented 1 year ago

The %W width calculation standard and %-30s seem to be inconsistent. The former can exclude mslp metacharacters, but %-30s does not.

2023-01-18 19:47:37 INPUT: #var foo {\e]68;1;SEND;bow\a\e[4mbow\e[24m}
#OK. VARIABLE {foo} HAS BEEN SET TO {\e]68;1;SEND;bow\a\e[4mbow\e[24m}.
2023-01-18 19:47:38 INPUT: #echo {width: %W} {$foo}
width: 3
2023-01-18 19:47:51 INPUT: #echo {width: [%-30s]} {$foo}
width: [bow  ]
scandum commented 1 year ago

Thanks. I don't think %W is a valid option, but %L is.

I've updated the beta with a fix for this.