0

I am trying to change the color of my tty in Solaris.  I am not referring to Xterm or termcap, but to the TTY itself.

I am a FreeBSD user.  For example, you can change the color directly from the VT driver, which is the console driver with the parameters:

kern.vt.color."colornum".rgb="colorspec"

Is it possible to do that in Solaris?  I have not been able to perform this task.

1 Answer 1

1

The original Sun console is monochrome; a later version (after 2000) provides for ANSI colors. The comments in ncurses terminfo for sun-color may help you determine if that applies to you:

# Most of the current references to sun-color are from users wondering why this
# is the default on install.  Details from reading the wscons manpage, adding
# cub, etc., here (rather than in the base sun-il entry) since it is not clear
# when those were added -TD (2005-05-28)
#
# According to wscons manpage, color is supported only on IA systems.
# Sun's terminfo entry documents bold and smul/rmul capabilities, but wscons
# does not list these.  It also sets ncv#3, however that corresponds to
# underline and standout.
#
# Since the documentation and terminfo do not agree, see also current code at
# https://web.archive.org/web/20091231042744/http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/tem_safe.c
#
# That (actually a different driver which "supports" sun-color) also supports
# these features:
#       vpa=\E[%i%p1%dd
#       hpa=\E[%i%p1%d`
#       cbt=\E[Z
#       dim=\E[2m
#       blink=\E[5m
# It supports bold, but not underline -TD (2009-09-19)

Sun's documentation (now Oracle) refers to this as the Coherent console, providing little documentation. Although it was available as early as 2005, "sun-color" was mentioned as a new feature in release notes in August 2007:

SPARC: Changes to How $TERM Value for Console Is Set
Solaris 10 8/07: The $TERM value is now dynamically derived and depends on the terminal emulator that the console is using. On x86 based systems, the $TERM value is sun-color because the kernel's terminal emulator is always used.

On SPARC based systems the $TERM value is as follows:

sun-color

This value is used for $TERM if the system uses the kernel's terminal emulator.

sun

This value is used for $TERM if the system uses the PROM's terminal emulator.

This change does not impact how the terminal type is set for the serial port. You can still use the svccfg command to modify the $TERM value, as shown in the following example:

But the example given is odd, because the console's behavior did not match xterm:

    # svccfg
    svc:> select system/console-login
    svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
    svc:/system/console-login> exit

The documentation for the "real" console terminal, wscons says

Note: The VT100 adheres the ANSI X3.64 standard. However, because the VT100 features nonstandard extensions to ANSI X3.64, it is incompatible with Sun terminal emulators.

referring to the way scrolling is done, and because xterm emulates VT100 (and higher-level models of DEC terminals), the example is flawed.

9
  • I understand that I executed the infocmp command and I was able to verify that I have a sun-color console, but how could I compile/modify those parameters? Commented Apr 17, 2024 at 20:03
  • If "infocmp sun-color" shows useful output, to use that terminal description you would set the TERM environment variable to sun-color to make your shell application use it. Some hard-coded applications will not pay proper attention... Commented Apr 20, 2024 at 11:49
  • Thanks for your support, I could see from the tput output the following: tput setaf 1 | od -c And I could print in color echo -e '\e[31m HI' As you said, you can only do it with ANSI colors. I would like to use light colors, but they are not supported. Could I use another ncurse terminfo with support for those colors? Commented Apr 24, 2024 at 18:38
  • probably not - none of the (sketchy) descriptions of the Coherent Console mention changing the color palette Commented Apr 24, 2024 at 19:03
  • In the following path I have more terminfo "config" /usr/share/lib/terminfo example screen in s dir. Solaris could use any of these configurations that support those types of colors? Commented Apr 24, 2024 at 19:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.