Repterm
Core Concepts

Shell Integration

How Repterm detects prompts and captures output using OSC 133 and fallback layers.

Three-Layer Prompt Detection

Repterm uses a layered prompt detection system that automatically selects the best available method:

LayerMethodPrecisionExit Code
1OSC 133 (FinalTerm standard)Exact semantic markers (A/B/C/D)Captured from D marker
2Sentinel unique markerUnique string impossible in normal outputVia sentinel parsing
3Enhanced regexPattern-based prompt matchingNot available

The system tries each layer in order and uses the best one available.

Per-Command Override

You can override prompt detection per command via RunOptions.promptDetection:

// Use default auto-detection
await $`echo hello`;

// Force OSC 133 only
await $({ promptDetection: 'osc133' })`echo hello`;

// Force sentinel marker
await $({ promptDetection: 'sentinel' })`echo hello`;

// Force regex matching
await $({ promptDetection: 'regex' })`echo hello`;

// Skip prompt detection (for long-running or streaming commands)
await $({ promptDetection: 'none' })`tail -f /var/log/syslog`;

Shell Integration Configuration

Configure shell integration through TerminalConfig:

OptionDefaultDescription
enabledtrueInject shell integration markers
sentinelFallbacktrueEnable sentinel layer if OSC 133 is not available
shellauto-detectCustom shell path override

Supported Shells

ShellIntegration Method
BashPROMPT_COMMAND + DEBUG trap
Zshprecmd_functions + preexec_functions
Other shellsFalls back to regex detection (Layer 3)

Tmux Passthrough

In recording mode, OSC 133 markers are forwarded through DCS passthrough to ensure prompt detection works inside tmux sessions. This is configured automatically with set-option allow-passthrough on.