Paper icon indicating copy to clipboard operation
Paper copied to clipboard

ChatColor at the console appears as gray no matter what color is used

Open zhro opened this issue 3 years ago • 4 comments

Expected behavior

Color is expected to be present, as it is in Spigot.

Observed/Actual behavior

Color appears gray when any color is used.

Steps/models to reproduce

Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "RED WORDS!");
Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "GREEN WORDS!");
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "YELLOW WORDS!");
Bukkit.getConsoleSender().sendMessage(ChatColor.BLUE + "BLUE WORDS!");

Plugin and Datapack List

No plugins are used, other than a test plugin that outputs for testing.

Paper version

This server is running Paper version git-Paper-176 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: f7d16f6) You are running the latest version

Other

Here is what it looks like at the Paper console:

image

Here is what it looks like from the Spigot console:

image

zhro avatar Sep 27 '22 00:09 zhro

iirc, this is pretty much always a weird environment issue which can be fixed by flipping https://docs.papermc.io/paper/reference/global-configuration#use-rgb-for-named-text-colors

electronicboy avatar Sep 27 '22 00:09 electronicboy

Setting use-rgb-for-named-text-colors to false fixed this for me, and colors appear as expected.

What is the purpose of this option? I use Mintty for my terminal emulator. Is the default method of displaying colors incompatible with my terminal? My TTY type is set to xterm-256color.

zhro avatar Sep 27 '22 01:09 zhro

Your console doesn't support rgb colors, and so the default assumption towards supporting RGB fails, looks like we can maybe improve the detection here, hm...

https://github.com/fusesource/jansi/blob/master/src/main/java/org/fusesource/jansi/AnsiConsole.java#L405

electronicboy avatar Sep 27 '22 02:09 electronicboy

I'll mark this as a low priority issue as there are steps we can and should take here to prevent this from happening more often.

//edit: or at the very least look into improvements.

lynxplay avatar Sep 28 '22 18:09 lynxplay

@zhro Are you still able to produce this issue on the latest version of Paper 1.20.1 or newer? Paper has a new ANSI serializer which has improved terminal environment detection.

pop4959 avatar Aug 12 '23 21:08 pop4959

Closing this as the issue generally was improved by the change to the ansi serializer nor has this issue been active.

lynxplay avatar Nov 30 '23 08:11 lynxplay