#Check if console supports escape color codes
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
its console specific
which console gives you color characters instead of using them?
which console is not working properly?
and what do you want to accomplish?
you try to fix it via code?
you cant
its a console thing
the user would need to change its console/settings
I wouldnt mind
its called ANSI escape sequences
and not all consoles support it
theres nothing u can do about it
tell ur users to use an ANSI compatible console
thats all u can do
I would just ignore it
either dont use colors
or just tell the user to use an ANSI compatible console
no
u can try if (System.console() != null && System.getenv().get("TERM") != null) {
but it doesnt always work
essentially, it checks whether ur running on a linux terminal instead
and they usually support it
(not always, but often)
there are ofc also windows consoles that support it, but u cant detect it with that
or make some kind of config to disable it