fix(core): show the correct content in the tui terminal pane for skipped tasks (#31559)
## Current Behavior When a task is skipped (e.g. some dep(s) failed), the terminal pane is completely empty. If you navigate to another task and see its output and navigate back to the skipped task, then you see the correct title and borders but the output is wrong: it shows the output of the previous task.   ## Expected Behavior The TUI terminal pane should be correctly rendered for skipped tasks. It should correctly show the title, border and content (`Task was skipped`). 
This commit is contained in:
parent
17507ad023
commit
d0d62846a2
@ -1005,6 +1005,10 @@ impl App {
|
||||
in_progress && pty.can_be_interactive();
|
||||
terminal_pane_data.pty = Some(pty.clone());
|
||||
has_pty = true;
|
||||
} else {
|
||||
// Clear PTY data when switching to a task that doesn't have a PTY instance
|
||||
terminal_pane_data.pty = None;
|
||||
terminal_pane_data.can_be_interactive = false;
|
||||
}
|
||||
|
||||
let is_focused = match self.focus {
|
||||
|
||||
@ -496,6 +496,28 @@ impl<'a> StatefulWidget for TerminalPane<'a> {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the task was skipped, show skipped message
|
||||
if matches!(state.task_status, TaskStatus::Skipped) {
|
||||
let message_style = if state.is_focused {
|
||||
self.get_base_style(TaskStatus::Skipped)
|
||||
} else {
|
||||
self.get_base_style(TaskStatus::Skipped)
|
||||
.add_modifier(Modifier::DIM)
|
||||
};
|
||||
let message = vec![Line::from(vec![Span::styled(
|
||||
"Task was skipped",
|
||||
message_style,
|
||||
)])];
|
||||
|
||||
let paragraph = Paragraph::new(message)
|
||||
.block(block)
|
||||
.alignment(Alignment::Center)
|
||||
.style(Style::default());
|
||||
|
||||
Widget::render(paragraph, safe_area, buf);
|
||||
return;
|
||||
}
|
||||
|
||||
let inner_area = block.inner(safe_area);
|
||||
|
||||
if let Some(pty_data) = &self.pty_data {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user