Raxol.Terminal.Commands.OSCHandlers (Raxol v0.4.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 1 (Set Icon Name)

Handles OSC 4 (Set/Query Color Palette).

Handles OSC 7 (Set/Query Current Working Directory URL) and stores it in emulator state.

Handles OSC 8 (Hyperlink) and stores hyperlink state in emulator.

Handles OSC 52 (Set/Query Clipboard Data) with selection clarification.

Functions

handle_0_or_2(emulator, pt)

@spec handle_0_or_2(Raxol.Terminal.Emulator.t(), String.t()) ::
  {:ok, Raxol.Terminal.Emulator.t()}
  | {:error, atom(), Raxol.Terminal.Emulator.t()}

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

handle_1(emulator, pt)

Handles OSC 1 (Set Icon Name)

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) and stores it in emulator state.

handle_8(emulator, pt)

Handles OSC 8 (Hyperlink) and stores hyperlink state in emulator.

handle_52(emulator, pt)

Handles OSC 52 (Set/Query Clipboard Data) with selection clarification.