Functional drawing of plugins to the screen

This commit is contained in:
Brooks J Rady 2021-01-06 13:40:16 +00:00
parent d509b0c339
commit 931384d42f
3 changed files with 8 additions and 8 deletions

View file

@ -544,17 +544,22 @@ impl Tab {
self.full_screen_ws.columns as u16, self.full_screen_ws.columns as u16,
self.full_screen_ws.rows as u16, self.full_screen_ws.rows as u16,
); );
for (_, terminal) in self.panes.iter_mut() { for (kind, terminal) in self.panes.iter_mut() {
if !self.panes_to_hide.contains(&terminal.pid()) { if !self.panes_to_hide.contains(&terminal.pid()) {
boundaries.add_rect(&terminal); boundaries.add_rect(&terminal);
if let Some(vte_output) = terminal.render() { if let Some(vte_output) = terminal.render() {
let vte_output = if let PaneKind::Terminal(_) = kind {
vte_output
} else {
pad_to_size(&vte_output, terminal.rows(), terminal.columns())
};
// FIXME: Use Termion for cursor and style clearing? // FIXME: Use Termion for cursor and style clearing?
write!( write!(
stdout, stdout,
"\u{1b}[{};{}H\u{1b}[m{}", "\u{1b}[{};{}H\u{1b}[m{}",
terminal.y() + 1, terminal.y() + 1,
terminal.x() + 1, terminal.x() + 1,
pad_to_size(&vte_output, terminal.rows(), terminal.columns()) vte_output
).expect("cannot write to stdout"); ).expect("cannot write to stdout");
} }
} }

View file

@ -113,11 +113,7 @@ impl Pane for PluginPane {
.unwrap(); .unwrap();
self.should_render = false; self.should_render = false;
let goto_plugin_coordinates = format!("\u{1b}[{};{}H", self.y() + 1, self.x() + 1); // goto row/col and reset styles Some(buf_rx.recv().unwrap())
let reset_styles = "\u{1b}[m";
let buf = pad_to_size(&buf_rx.recv().unwrap(), self.rows(), self.columns());
let vte_output = format!("{}{}{}", goto_plugin_coordinates, reset_styles, buf);
Some(vte_output)
} else { } else {
None None
} }

View file

@ -193,7 +193,6 @@ impl Pane for TerminalPane {
} }
} }
character_styles.clear(); character_styles.clear();
vte_output.push('\n');
} }
self.mark_for_rerender(); self.mark_for_rerender();
Some(vte_output) Some(vte_output)