Raxol.Terminal.Commands.OSCHandlers (Raxol v0.3.0)
View SourceHandles 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
@spec handle_0_or_2(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Handles OSC 0 (Set Icon Name and Window Title) or OSC 2 (Set Window Title)
@spec handle_4(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
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
@spec handle_7(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Handles OSC 7 (Set/Query Current Working Directory URL)
@spec handle_8(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Handles OSC 8 (Hyperlink)
@spec handle_52(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Handles OSC 52 (Set/Query Clipboard Data)