Console

„TTY“ steht für „teletype“. Mit „teletypewriter“ wird ein Text-Terminal bezeichnet.

Typen:

  • tty0: virtuelle Konsole im Vordergrund (VGA)

  • ttyX: jede andere virtuelle Konsole

  • ttySx: serieller Port

  • lp0: der erste parallele Port

  • ttyUSB0: das erste serielle USB-Device

Kernel-Parameter (Angabe mehrer Konsolen ist möglich, Output erscheint dann auf allen angegebenen):

# COM2, 9600 baud
console=ttyS1,9600 console=tty0

ESC-Codes

Die „linux“ TTY-Konsole (erkennbar am echo $TERM) kennt unter anderem folgende Escape-Codes:

  • \e[1~: beginning-of-line

  • \e[2~: quoted-insert

  • \e[3~: delete-char

  • \e[4~: end-of-line

  • \e[5~: beginning-of-history

  • \e[6~: end-of-history

  • \e]: OSC (Operating System Command)

    • \e]Pnrrggbb: n is the color number (0–15), and rrggbb indicates the red/green/blue values (0–255)

    • \e]R: reset palette

Eine Suche nach „Customizing the Linux framebuffer“ hilft.

Color Numbers - Background:

  • 0 Black

  • 1 Red

  • 2 Green

  • 3 Yellow

  • 4 Blue

  • 5 Magenta

  • 6 Cyan

  • 7 White

Color Numbers - Foreground:

  • 8 Black

  • 9 Red

  • A Green

  • B Yellow

  • C Blue

  • D Magenta

  • E Cyan

  • F White

Solarized Farbschema in der TTY setzen

Siehe auch:

Solarized Light:

~/.bashrc
if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0fdf6e3"      # Solarized: Base3
    echo -en "\e]P1dc322f"      # Solarized: Red
    echo -en "\e]P2859900"      # Solarized: Green
    echo -en "\e]P3b58900"      # Solarized: Yellow
    echo -en "\e]P4268bd2"      # Solarized: Blue
    echo -en "\e]P5d33682"      # Solarized: Magenta
    echo -en "\e]P62aa198"      # Solarized: Cyan
    echo -en "\e]P7657b83"      # Solarized: Base00
    echo -en "\e]P8eee8d5"      # Solarized: Base2
    echo -en "\e]P9cb4b16"      # Solarized: Orange
    echo -en "\e]PA93a1a1"      # Solarized: Base1
    echo -en "\e]PB839496"      # Solarized: Base0
    echo -en "\e]PC657b83"      # Solarized: Base00
    echo -en "\e]PD6c71c4"      # Solarized: Violet
    echo -en "\e]PE586e75"      # Solarized: Base01
    echo -en "\e]PF002b36"      # Solarized: Base03
    clear # against bg artifacts
fi

Solarized Dark:

~/.bashrc
if [ "$TERM" = "linux" ]; then
    echo -en "\e]PB657b83" # S_base00
    echo -en "\e]PA586e75" # S_base01
    echo -en "\e]P0073642" # S_base02
    echo -en "\e]P62aa198" # S_cyan
    echo -en "\e]P8002b36" # S_base03
    echo -en "\e]P2859900" # S_green
    echo -en "\e]P5d33682" # S_magenta
    echo -en "\e]P1dc322f" # S_red
    echo -en "\e]PC839496" # S_base0
    echo -en "\e]PE93a1a1" # S_base1
    echo -en "\e]P9cb4b16" # S_orange
    echo -en "\e]P7eee8d5" # S_base2
    echo -en "\e]P4268bd2" # S_blue
    echo -en "\e]P3b58900" # S_yellow
    echo -en "\e]PFfdf6e3" # S_base3
    echo -en "\e]PD6c71c4" # S_violet
    clear # against bg artifacts
fi

Built on 2024-11-18