#Check if console supports escape color codes

1 messages · Page 1 of 1 (latest)

clever pivotBOT
#

<@&987246652869971988> please have a look, thanks.

clever pivotBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

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.

shell shore
#

its console specific

#

which console gives you color characters instead of using them?

shell shore
#

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

stuck brook
#

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

shell shore
#

I would just ignore it

#

either dont use colors

#

or just tell the user to use an ANSI compatible console

stuck brook
#

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

shell shore
#

or make some kind of config to disable it

frank glacier
#

@clear viper jansi

#

google thagt library