Skip to main content

par_term_config/
scrollback_mark.rs

1/// Public-facing metadata for a mark anchored to a scrollback line.
2///
3/// This is a shared type used by both the terminal module (which creates marks
4/// from shell integration events) and the renderer module (which displays
5/// marks in the scrollbar and separator lines).
6#[derive(Clone, Debug, PartialEq, Eq)]
7pub struct ScrollbackMark {
8    /// The absolute scrollback line index this mark is anchored to.
9    pub line: usize,
10    /// Exit code of the command at this mark, if captured by shell integration.
11    pub exit_code: Option<i32>,
12    /// Unix timestamp (seconds) when the command started, if captured.
13    pub start_time: Option<u64>,
14    /// Elapsed time in milliseconds for the command, if captured.
15    pub duration_ms: Option<u64>,
16    /// The command string at this mark, if captured.
17    pub command: Option<String>,
18    /// Custom color override (from trigger marks). When set, overrides exit_code-based coloring.
19    pub color: Option<(u8, u8, u8)>,
20    /// Trigger ID that created this mark (None for shell integration marks).
21    /// Used for deduplication: the same trigger matching the same physical line
22    /// across multiple scans produces marks at different absolute positions.
23    pub trigger_id: Option<u64>,
24}