Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console colors no longer showing post Jline fix. #11637

Closed
andrewkm opened this issue Nov 19, 2024 · 7 comments
Closed

Console colors no longer showing post Jline fix. #11637

andrewkm opened this issue Nov 19, 2024 · 7 comments
Labels
size: small status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. version: 1.21.3 Game version 1.21.3

Comments

@andrewkm
Copy link

andrewkm commented Nov 19, 2024

Expected behavior

Console colors to properly display.

Observed/Actual behavior

No console colors.
Using LuckPerms as an example as I'm sure we're all aware of how it looks with colors on startup:
https://i.imgur.com/4zOacF1.png

Steps/models to reproduce

  • Use any build that includes the following commit: d8b66dd
  • Use any build before that commit and no problems arise, colors work just fine.

Environment:
Paper 1.21.3-44-master@85bfdc0
Windows Server 2022 21H2 (OS Build 20348.2849)
Java 23.0.1 (64-Bit Server VM 23.0.1+11-39)

Startup line currently using:
-Xms12288M -Xmx12288M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -Djdk.console=java.base -jar paper.jar --nogui

PS: I have tried with removing -Djdk.console=java.base and get same result. I have also tried with Java 21, same result.

Plugin and Datapack List

On request.

Paper version

Paper 1.21.3-44-master@85bfdc0

Other

Let me know if you require further information.

@masmc05
Copy link
Contributor

masmc05 commented Nov 20, 2024

Does -Dnet.kyori.ansi.colorLevel=truecolor flag change anything for you?

@andrewkm
Copy link
Author

-Dnet.kyori.ansi.colorLevel=truecolor

Yes, adding this flag has fixed colors for us. 👍

@masmc05
Copy link
Contributor

masmc05 commented Nov 20, 2024

Seems like color capability detection broke further with that commit, as before it was just deciding to downsample colors in some environments like docker/Pterodactyl, even if it supported the true colors

@electronicboy
Copy link
Member

We no longer include jansi, and looks like the ansi serialiser doesn't declare its own dep on that publically, and so it's just falling back to trying to detect based on the env. These types of detections always kinda suck as there is no good universal way to detect this kind of thing

@MiniDigger
Copy link
Member

MiniDigger commented Nov 21, 2024

ok, so I spend a bit of time looking at this. cat is right that we no longer include jansi (as we don't need it).
however jansi changes the detection in adventure. it first tries to look at system properties, then env vars, then jansi. if no jansi is present, it assumes no color. however, jansis detection works similarly, has overrides as system properties and checks env vars, but if that doesn't find stuff, it falls back to 16 colors. so basically, just adding ansi changes the default adventure uses.
just shipping jansi for that seems like unnecessary bloat to me and I will be talked with the other adventure peeps to change the default.

oh and you can remove -Djdk.console=java.base as paper sets that now

+ System.setProperty("jdk.console", "java.base"); // Paper - revert default console provider back to java.base so we can have our own jline

MiniDigger added a commit to MiniDigger/ansi that referenced this issue Nov 21, 2024
we now treat every interactive terminal as supporting at least 16 colors and make the (COLOR)TERM checks more broad

ref: PaperMC/Paper#11637

Co-authored-by: Riley Park <[email protected]>
@MiniDigger MiniDigger added type: bug Something doesn't work as it was intended to. status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. version: 1.21.3 Game version 1.21.3 size: small and removed status: needs triage labels Nov 21, 2024
@papermc-projects papermc-projects bot moved this to ✅ Accepted in Issues: Bugs Nov 21, 2024
MiniDigger added a commit to MiniDigger/ansi that referenced this issue Nov 21, 2024
we now treat every interactive terminal as supporting at least 16 colors and make the (COLOR)TERM checks more broad

ref: PaperMC/Paper#11637

Co-authored-by: Riley Park <[email protected]>
@lynxplay
Copy link
Contributor

Should be resolved now that we bumped to adventure 4.18 👍

@github-project-automation github-project-automation bot moved this from ✅ Accepted to Done in Issues: Bugs Dec 27, 2024
@andrewkm
Copy link
Author

andrewkm commented Jan 1, 2025

Confirmed fixed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: small status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. version: 1.21.3 Game version 1.21.3
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants