Raxol.Terminal.Commands.OSCHandlers (Raxol v0.3.0)

View Source

Handles the execution logic for specific OSC commands.

Functions are called by Raxol.Terminal.Commands.Executor after initial parsing.

Summary

Functions

Handles OSC 0 (Set Icon Name and Window Title) or OSC 2 (Set Window Title)

Handles OSC 4 (Set/Query Color Palette).

Handles OSC 7 (Set/Query Current Working Directory URL)

Handles OSC 8 (Hyperlink)

Handles OSC 52 (Set/Query Clipboard Data)

Functions

handle_0_or_2(emulator, pt)

Handles OSC 0 (Set Icon Name and Window Title) or OSC 2 (Set Window Title)

handle_4(emulator, pt)

Handles OSC 4 (Set/Query Color Palette).

Format: OSC 4 ; c ; spec ST

  • c: Color index (0-255)
  • spec: Color specification or "?" for query

Color specifications supported:

  • rgb:RRRR/GGGG/BBBB (hex, 1-4 digits per component)
  • #RRGGBB (hex, 2 digits per component)
  • #RGB (hex, 1 digit per component)
  • #RRGGBBAA (hex with alpha, 2 digits per component)
  • rgb(r,g,b) (decimal, 0-255)
  • rgb(r%,g%,b%) (percentage, 0-100%)

Returns:

  • For set: Updated emulator with new color in palette
  • For query: Emulator with response in output_buffer

handle_7(emulator, pt)

Handles OSC 7 (Set/Query Current Working Directory URL)

handle_8(emulator, pt)

Handles OSC 8 (Hyperlink)

handle_52(emulator, pt)

Handles OSC 52 (Set/Query Clipboard Data)