MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / scroll_logs

Method scroll_logs

crates/openshell-tui/src/app.rs:1959–1977  ·  view source on GitHub ↗

Scroll logs by a delta (positive = down, negative = up).

(&mut self, delta: isize)

Source from the content-addressed store, hash-verified

1957
1958 /// Scroll logs by a delta (positive = down, negative = up).
1959 pub fn scroll_logs(&mut self, delta: isize) {
1960 let filtered_len = self.filtered_log_lines().len();
1961 let max_scroll = self.log_autoscroll_offset();
1962 if delta < 0 {
1963 self.sandbox_log_scroll = self.sandbox_log_scroll.saturating_sub(delta.unsigned_abs());
1964 self.log_autoscroll = false;
1965 } else {
1966 self.sandbox_log_scroll =
1967 (self.sandbox_log_scroll + delta.cast_unsigned()).min(max_scroll);
1968 }
1969 let visible = filtered_len
1970 .saturating_sub(self.sandbox_log_scroll)
1971 .min(self.log_viewport_height);
1972 if visible > 0 {
1973 self.log_cursor = self.log_cursor.min(visible - 1);
1974 } else {
1975 self.log_cursor = 0;
1976 }
1977 }
1978
1979 // ------------------------------------------------------------------
1980 // Create sandbox modal (simplified — pick existing providers by name)

Callers 2

runFunction · 0.80
handle_logs_keyMethod · 0.80

Calls 3

lenMethod · 0.80
filtered_log_linesMethod · 0.80
log_autoscroll_offsetMethod · 0.80

Tested by

no test coverage detected