diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-06 13:40:16 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-06 13:40:16 +0000 |
| commit | 931384d42fbaf81fe84d5b1072a4d24ec2fb68b9 (patch) | |
| tree | e7635a095df952bfed473a911d4e91363a1c814f /src | |
| parent | Very nearly working (diff) | |
| download | sl0ppij-931384d42fbaf81fe84d5b1072a4d24ec2fb68b9.tar.gz sl0ppij-931384d42fbaf81fe84d5b1072a4d24ec2fb68b9.tar.xz sl0ppij-931384d42fbaf81fe84d5b1072a4d24ec2fb68b9.zip | |
Functional drawing of plugins to the screen
Diffstat (limited to 'src')
| -rw-r--r-- | src/tab.rs | 9 | ||||
| -rw-r--r-- | src/terminal_pane/plugin_pane.rs | 6 | ||||
| -rw-r--r-- | src/terminal_pane/terminal_pane.rs | 1 |
3 files changed, 8 insertions, 8 deletions
@@ -544,17 +544,22 @@ impl Tab { self.full_screen_ws.columns 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()) { boundaries.add_rect(&terminal); 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? write!( stdout, "\u{1b}[{};{}H\u{1b}[m{}", terminal.y() + 1, terminal.x() + 1, - pad_to_size(&vte_output, terminal.rows(), terminal.columns()) + vte_output ).expect("cannot write to stdout"); } } diff --git a/src/terminal_pane/plugin_pane.rs b/src/terminal_pane/plugin_pane.rs index 3d525fa7..f74d5df0 100644 --- a/src/terminal_pane/plugin_pane.rs +++ b/src/terminal_pane/plugin_pane.rs @@ -113,11 +113,7 @@ impl Pane for PluginPane { .unwrap(); self.should_render = false; - let goto_plugin_coordinates = format!("\u{1b}[{};{}H", self.y() + 1, self.x() + 1); // goto row/col and reset styles - 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) + Some(buf_rx.recv().unwrap()) } else { None } diff --git a/src/terminal_pane/terminal_pane.rs b/src/terminal_pane/terminal_pane.rs index 096e9836..7f335d69 100644 --- a/src/terminal_pane/terminal_pane.rs +++ b/src/terminal_pane/terminal_pane.rs @@ -193,7 +193,6 @@ impl Pane for TerminalPane { } } character_styles.clear(); - vte_output.push('\n'); } self.mark_for_rerender(); Some(vte_output) |
