Open propensive opened 4 years ago
https://stackoverflow.com/questions/1403772/how-can-i-check-if-a-java-programs-input-output-streams-are-connected-to-a-term https://superuser.com/questions/157563/programmatic-access-to-current-xterm-background-color/406172#406172 https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands
$ /opt/scala-2.12.8/bin/scala
Welcome to Scala 2.12.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_201).
Type in expressions for evaluation. Or try :help.
scala> import sys.process._
import sys.process._
scala> val esc = 27.toChar
esc: Char =
scala> val str = s"""${esc}]11;?${esc}\\"""
str: String =
scala> val str2 = s""""${esc}]11;?${esc}\\""""
str2: String = ""
http://thrysoee.dk/xtermcontrol/ — it works!
$ xtermcontrol --get-bg
rgb:0000/2b2b/3636
$ xtermcontrol --bg rgb:000
$ xtermcontrol --get-bg
rgb:0000/0000/0000
Does it work everywhere?
It either works, or prints a nice error message. The problem is that this is an additional program, available in repositories only for some Linux distributions.
A good start would be to take the existing "full color" scheme and invert all the values.