Zum Inhalt

xterm - X Window System Terminal Emulator

generieren

xterm ist der Standard-Terminal-Emulator für das X Window System, der als Grundlage für viele moderne Terminalanwendungen dient. Ursprünglich 1984 entwickelt, bleibt xterm einer der am weitesten verbreiteten und funktionsreichen Terminal-Emulatoren in Unix-ähnlichen Systemen. Es bietet umfangreiche Anpassungsmöglichkeiten, Unicode-Unterstützung und dient als Referenz-Implementierung für Terminal-Emulationsstandards.

Installation

Linux (Debian/Ubuntu)

bash sudo apt update sudo apt install xterm_

Linux (Red Hat/CentOS/Fedora)

```bash sudo dnf install xterm

or on older systems:

sudo yum install xterm ```_

Linux (Arch)

bash sudo pacman -S xterm_

macOS (mit X11)

```bash

Install XQuartz first, then:

brew install xterm ```_

FreeBSD

bash pkg install xterm_

Basisnutzung

Starting xterm

```bash

Basic xterm window

xterm

Start with specific title

xterm -title "My Terminal"

Start with specific geometry

xterm -geometry 80x24+100+100

Start with specific font

xterm -fn "fixed"

Start in fullscreen

xterm -fullscreen ```_

Kommandozeilenoptionen

```bash

Display options

xterm -display :0.0 xterm -geometry 132x43 xterm -iconic xterm -maximized

Font options

xterm -fn "9x15" xterm -fa "Monospace:size=12" xterm -fs 14

Color options

xterm -fg white -bg black xterm -rv # Reverse video xterm -cm # Color mode

Scrolling options

xterm -sb # Enable scrollbar xterm -sl 1000 # Set scrollback lines xterm -si # Scroll on input xterm -sk # Scroll on key press

Logging options

xterm -l # Enable logging xterm -lf logfile.txt # Log to specific file ```_

Keyboard Shortcuts

Textauswahl und Zwischenablage

```bash

Text selection

Left Click + Drag # Select text Double Click # Select word Triple Click # Select line Shift + Left Click # Extend selection

Clipboard operations

Ctrl + Shift + C # Copy (modern xterm) Ctrl + Shift + V # Paste (modern xterm) Middle Click # Paste selection (traditional) Shift + Insert # Paste clipboard

Traditional X11 clipboard

Select text # Automatically copies to primary selection Middle Click # Paste primary selection ```_

Fenster- und Schriftsteuerung

```bash

Font size control

Ctrl + Right Click # Font menu Ctrl + Plus # Increase font size Ctrl + Minus # Decrease font size Ctrl + 0 # Reset font size

Window operations

Alt + F4 # Close window Alt + F10 # Maximize window Alt + F9 # Minimize window Alt + F5 # Restore window ```_

Scrolling

```bash

Scrollback navigation

Shift + Page Up # Scroll up one page Shift + Page Down # Scroll down one page Shift + Home # Scroll to top Shift + End # Scroll to bottom Shift + Up Arrow # Scroll up one line Shift + Down Arrow # Scroll down one line ```_

Terminal Control

```bash

Terminal reset and clear

Ctrl + L # Clear screen reset # Reset terminal state clear # Clear screen content

Process control

Ctrl + C # Interrupt (SIGINT) Ctrl + Z # Suspend (SIGTSTP) Ctrl + D # EOF/Exit Ctrl + \ # Quit (SIGQUIT) ```_

Mouse Operationen

Kontextmenüs

```bash

Main menu (Ctrl + Left Click)

  • New Window
  • Print Window
  • Redraw Window
  • Send Signal
  • Quit

VT Options menu (Ctrl + Middle Click)

  • Enable/Disable Scrollbar
  • Enable/Disable Jump Scroll
  • Enable/Disable Reverse Video
  • Enable/Disable Auto Wraparound
  • Enable/Disable Reverse Wraparound
  • Enable/Disable Auto Linefeed
  • Enable/Disable Application Cursor Keys
  • Enable/Disable Application Keypad
  • Scroll to Bottom on Output
  • Scroll to Bottom on Key
  • Allow 80/132 Column Switching
  • Keep Selection
  • Select to Clipboard

VT Fonts menu (Ctrl + Right Click)

  • Default Font
  • Tiny Font
  • Small Font
  • Medium Font
  • Large Font
  • Huge Font
  • Escape Sequence Font
  • Selection Font ```_

Auswahlmodus

```bash

Selection types

Single Click # Position cursor Double Click # Select word Triple Click # Select line Quadruple Click # Select all

Extended selection

Shift + Click # Extend selection Ctrl + Click # Rectangular selection Alt + Click # Line selection mode ```_

Konfiguration

Konfiguration der Befehlszeile

```bash

Resource file options

xterm -xrm "XTermbackground: black" xterm -xrm "XTermforeground: white" xterm -xrm "XTermfont: 9x15" xterm -xrm "XTermscrollBar: true"

Multiple resources

xterm -xrm "XTermbackground: black" \ -xrm "XTermforeground: green" \ -xrm "XTerm*font: fixed" ```_

X Ressourcenkonfiguration (~/.Xresources)

```bash ! Basic appearance XTermbackground: black XTermforeground: white XTermcursorColor: yellow XTermpointerColor: red XTerm*borderColor: blue

! Font configuration XTermfont: -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 XTermboldFont: -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1 XTermfaceName: Liberation Mono:size=12:antialias=false XTermfaceSize: 12

! Scrolling XTermscrollBar: true XTermscrollbar.width: 8 XTermrightScrollBar: true XTermsaveLines: 10000 XTermscrollTtyOutput: false XTermscrollKey: true

! Bell configuration XTermvisualBell: true XTermbellIsUrgent: true

! Selection and clipboard XTermhighlightSelection: true XTermtrimSelection: true XTermcutNewline: false XTermcutToBeginningOfLine: false XTerm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48

! Terminal behavior XTermloginShell: true XTermjumpScroll: true XTermmultiScroll: true XTermtoolBar: false XTerm*titeInhibit: false

! Color scheme (Solarized Dark example) XTermcolor0: #073642 XTermcolor1: #dc322f XTermcolor2: #859900 XTermcolor3: #b58900 XTermcolor4: #268bd2 XTermcolor5: #d33682 XTermcolor6: #2aa198 XTermcolor7: #eee8d5 XTermcolor8: #002b36 XTermcolor9: #cb4b16 XTermcolor10: #586e75 XTermcolor11: #657b83 XTermcolor12: #839496 XTermcolor13: #6c71c4 XTermcolor14: #93a1a1 XTermcolor15: #fdf6e3 ```_

X Ressourcen anwenden

```bash

Load resources

xrdb -merge ~/.Xresources

Load and replace all resources

xrdb -load ~/.Xresources

View current resources

xrdb -query

Remove all resources

xrdb -remove ```_

Erweiterte Funktionen

Unicode und Internationalisierung

```bash

UTF-8 support

xterm -u8

Locale-specific startup

LC_ALL=en_US.UTF-8 xterm

Font configuration for Unicode

XTermutf8: 1 XTermlocale: true XTermutf8Title: true XTermfontMenufontdefaultLabel: Default XTermfaceName: DejaVu Sans Mono:size=11 XTermfaceNameDoublesize: WenQuanYi Zen Hei Mono:size=11 ```_

Terminal Emulationsmodi

```bash

VT100 mode

xterm -tn vt100

VT220 mode

xterm -tn vt220

Linux console mode

xterm -tn linux

Set terminal type

export TERM=xterm-256color ```_

Protokollierung und Sitzungsaufzeichnung

```bash

Enable logging

xterm -l -lf ~/xterm.log

Logging with timestamp

xterm -l -lf ~/xterm-$(date +%Y%m%d-%H%M%S).log

Session recording with script

script -f ~/session.log

Then start xterm within the script session

```_

Sicherheitsmerkmale

```bash

Disable dangerous features

XTermallowSendEvents: false XTermallowWindowOps: false XTermallowTitleOps: false XTermallowFontOps: false

Secure keyboard input

XTerm*secureKeyboard: true

Disable menu access

XTerm*omitTranslation: popup-menu ```_

Anwendungsbeispiele

Farbschemata

```bash

Solarized Light

XTermbackground: #fdf6e3 XTermforeground: #657b83 XTermfadeColor: #fdf6e3 XTermcursorColor: #586e75 XTermpointerColorBackground: #93a1a1 XTermpointerColorForeground: #586e75

Monokai

XTermbackground: #272822 XTermforeground: #f8f8f2 XTermcursorColor: #f8f8f0 XTermcolor0: #272822 XTermcolor1: #f92672 XTermcolor2: #a6e22e XTermcolor3: #f4bf75 XTermcolor4: #66d9ef XTermcolor5: #ae81ff XTermcolor6: #a1efe4 XTerm*color7: #f8f8f2

Gruvbox Dark

XTermbackground: #282828 XTermforeground: #ebdbb2 XTermcolor0: #282828 XTermcolor1: #cc241d XTermcolor2: #98971a XTermcolor3: #d79921 XTermcolor4: #458588 XTermcolor5: #b16286 XTermcolor6: #689d6a XTermcolor7: #a89984 ```_

Schriftkonfigurationen

```bash

Bitmap fonts

XTermfont: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 XTermboldFont: -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-1

TrueType fonts

XTermfaceName: Inconsolata:size=12 XTermfaceSize: 12 XTerm*renderFont: true

Multiple font sizes

XTermfaceSize1: 8 XTermfaceSize2: 10 XTermfaceSize3: 12 XTermfaceSize4: 14 XTermfaceSize5: 16 XTermfaceSize6: 18 ```_

Integration von Windows

```bash

Window class and name

XTermiconName: Terminal XTermtitle: xterm XTerm*geometry: 80x24+0+0

Window manager hints

XTermallowWindowOps: true XTermdisallowedWindowOps: 1,2,3,4,5,6,7,8,9,11,13,18,19

Session management

XTerm*sessionMgt: true ```_

Fehlerbehebung

Gemeinsame Themen

```bash

Font problems

xlsfonts|grep fixed # List available fonts xterm -fn fixed # Use basic fixed font fc-list : family|grep Mono # List monospace fonts

Color issues

echo $TERM # Check terminal type tput colors # Check color support xterm -tn xterm-256color # Force 256 color mode

Clipboard problems

xclip -version # Check if xclip is installed xsel --version # Check if xsel is installed echo $DISPLAY # Verify X11 display

Locale issues

locale # Check current locale xterm -u8 # Enable UTF-8 mode export LANG=en_US.UTF-8 # Set UTF-8 locale ```_

Leistungsoptimierung

```bash

Disable unnecessary features

XTermjumpScroll: true XTermmultiScroll: true XTerm*fastScroll: true

Reduce resource usage

XTermsaveLines: 1000 # Limit scrollback XTermvisualBell: false # Disable visual bell XTerm*toolBar: false # Disable toolbar

Font rendering optimization

XTermrenderFont: true XTermantialias: true XTerm*faceSize: 11 ```_

Debugging

```bash

Debug mode

xterm -debug 1

Verbose output

xterm -verbose

Check resources

xrdb -query|grep -i xterm

Test configuration

xterm -xrm "XTerm*background: red" -geometry 40x10 ```_

Integration mit anderen Tools

Terminal Multiplexer

```bash

With tmux

xterm -e tmux

With screen

xterm -e screen

With specific session

xterm -e "tmux attach-session -t main" ```_

Integration von Shell

```bash

Specific shell

xterm -e bash xterm -e zsh xterm -e fish

Login shell

xterm -ls

Execute command and exit

xterm -e "ls -la; read" ```_

Fenstermanager Scripts

```bash

!/bin/bash

Launch multiple xterm windows

xterm -geometry 80x24+0+0 -title "Main" & xterm -geometry 80x24+400+0 -title "Logs" -e "tail -f /var/log/syslog" & xterm -geometry 80x24+0+300 -title "Monitor" -e "htop" & ```_

Best Practices

Konfigurationsmanagement

```bash

Use version control for configs

cd ~ git init git add .Xresources git commit -m "Initial xterm configuration"

Backup configurations

cp ~/.Xresources ~/.Xresources.backup ```_

Sicherheitsüberlegungen

```bash

Disable dangerous operations

XTermallowSendEvents: false XTermallowWindowOps: false XTerm*allowTitleOps: false

Use secure keyboard mode

XTerm*secureKeyboard: true

Limit font operations

XTerm*allowFontOps: false ```_

Leistungsspitzen

```bash

Optimize for speed

XTermjumpScroll: true XTermmultiScroll: true XTerm*fastScroll: true

Limit resource usage

XTermsaveLines: 2000 XTermbuffered: true ```_

xterm bleibt der Goldstandard für Terminal-Emulation in Unix-ähnlichen Systemen, bietet unvergleichliche Anpassung und Kompatibilität. Seine umfangreichen Feature-Set- und Konfigurationsoptionen machen es für alles von grundlegender Kommandozeilenarbeit bis hin zu komplexen Entwicklungsumgebungen geeignet. Xterms Fähigkeiten und Konfigurationsoptionen zu verstehen ist für jeden ernsthaften Unix/Linux-Benutzer unerlässlich.