Announcement

Collapse
No announcement yet.

Is Konsole not 'xterm-compatible'?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is Konsole not 'xterm-compatible'?

    I came across [this answer](https://unix.stackexchange.com/a/94306/61798) which indicates that dircolors can use 256 colors if the terminal is compatible with xterm.

    I have konsole, qterminal, xterm, rxvt-unicode, gnome-terminal and lxterminal installed on Kubuntu 18.04.

    Only Konsole and qterminal don't seem to use 256 colors and seem restricted to

    Code:
    # Text color codes:
    # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
    # Background color codes:
    # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
    So it seems that konsole and qterminal aren't "xterm-compatible". Is that correct?
    Kubuntu 20.04

    #2
    konsole was one of the first terminal emulators to support 24-bit colour. Indeed, according to the doc XTerm Control Sequences the xterm rgb support was based on konsole's. Try
    Code:
    c=($(seq 8 32 255))
    for r in $c;do for g in $c;do for b in $c;do echo -n "${csi}38;2;$r;$g;${b}m$r;$g:$b ";done ;done ;done
    So, to do ls --color in full RGB:
    Code:
    dircolors --print-database > rgb.dc
    # edit rgb.dc, changing any sequence to be 38;2;[i]r[/i];[i]g[/i];[i]b[/i] 
    # with the [i]r[/i], [i]g[/i] and [i]b[/i] a number from 0 to 255
    eval $(dircolors tgb.dc)
    You can use 48;2 to set the background, too. F.ex. 38;2;255;0;0;48;2;0;0;255 is red with blue bqackground. vim supports these sequences for syntax highlighting too; see :help xterm-true-color.
    Regards, John Little

    Comment


      #3
      Thanks and wow!

      It's going to take quite a while to digest and a "few" follow-up questions
      Kubuntu 20.04

      Comment

      Working...
      X