Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ Options:
Set the frame rate of the TUI (60 by default)
-m, --max-events <MAX_EVENTS>
Max number of events to keep in TUI (0=unlimited)
--scrollback-lines <SCROLLBACK_LINES>
Number of scrollback lines to keep in the pseudo terminal (1000 by default)
-D, --default-external-command <DEFAULT_EXTERNAL_COMMAND>
Set the default external command to run when using "Detach, Stop and Run Command" feature in Hit Manager
-b, --add-breakpoint <BREAKPOINTS>
Expand Down
3 changes: 3 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
# Max number of events to keep in TUI. (0=unlimited)
# max_events = 1_000_000

# Number of scrollback lines to keep in the pseudo terminal
# scrollback_lines = 1000

#
# Config for Log mode
#
Expand Down
7 changes: 7 additions & 0 deletions crates/tracexec-core/src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ pub struct TuiModeArgs {
help = "Max number of events to keep in TUI (0=unlimited)"
)]
pub max_events: Option<u64>,
#[clap(
long,
help = "Number of scrollback lines to keep in the pseudo terminal (1000 by default)",
requires = "tty"
)]
pub scrollback_lines: Option<usize>,
}

#[derive(Args, Debug, Default, Clone)]
Expand All @@ -515,6 +521,7 @@ impl TuiModeArgs {
self.layout = self.layout.or(config.layout);
self.frame_rate = self.frame_rate.or(config.frame_rate);
self.max_events = self.max_events.or(config.max_events);
self.scrollback_lines = self.scrollback_lines.or(config.scrollback_lines);
self.follow |= config.follow.unwrap_or_default();
if (!self.terminate_on_exit) && (!self.kill_on_exit) {
match config.exit_handling {
Expand Down
1 change: 1 addition & 0 deletions crates/tracexec-core/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub struct TuiModeConfig {
#[serde(default, deserialize_with = "deserialize_frame_rate")]
pub frame_rate: Option<f64>,
pub max_events: Option<u64>,
pub scrollback_lines: Option<usize>,
}

#[derive(Debug, Default, Clone, Deserialize, Serialize)]
Expand Down
1 change: 1 addition & 0 deletions crates/tracexec-tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ indexset = "0.15"
[dev-dependencies]
insta = "1.41.0"
serial_test = { workspace = true }
tracing-test = { workspace = true }
1 change: 1 addition & 0 deletions crates/tracexec-tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ impl App {
pixel_height: 0,
},
pty_master,
tui_args.scrollback_lines.unwrap_or(1000),
)?;
if active_pane == ActivePane::Terminal {
term.focus(true);
Expand Down
16 changes: 16 additions & 0 deletions crates/tracexec-tui/src/app/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,22 @@ impl App {
items.extend(help_item!("Q", "Quit"));
} else {
// Terminal
if let Some(term) = self.term.as_ref() {
if term.is_scrollback_mode() {
// In scrollback mode - show navigation keys highlighted
items.extend([
help_key("Ctrl+U"),
fancy_help_desc("Exit\u{00a0}Scroll"),
"\u{200b}".into(),
]);
items.extend(help_item!("↑↓", "Scroll"));
items.extend(help_item!("PgUp/PgDn", "Page"));
items.extend(help_item!("Home/End", "Jump"));
} else {
// Normal mode - show how to enter scrollback
items.extend(help_item!("Ctrl+U", "Scroll"));
}
}
if let Some(h) = self.hit_manager_state.as_ref()
&& h.count() > 0
{
Expand Down
Loading
Loading