diff options
author | Kerfuffle <44031344+KerfuffleV2@users.noreply.github.com> | 2022-02-28 09:54:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-28 17:54:41 +0100 |
commit | e2081f26494df7921208060199ab4122ee8695d2 (patch) | |
tree | d4b0978b6cf72358365fdfe4fd740628bbc7b393 /zellij-server/src/ui | |
parent | c2e06a1a70d8f1a383ada70c74165d4579fcf88e (diff) |
fix: Allow terminal title passthrough even when not drawing pane frames. (#1113)
* fix: Allow terminal title passthrough even when not drawing pane frames.
* Minor formatting fix.
* Handle case where the session name is not set.
Diffstat (limited to 'zellij-server/src/ui')
-rw-r--r-- | zellij-server/src/ui/pane_boundaries_frame.rs | 13 | ||||
-rw-r--r-- | zellij-server/src/ui/pane_contents_and_ui.rs | 9 |
2 files changed, 10 insertions, 12 deletions
diff --git a/zellij-server/src/ui/pane_boundaries_frame.rs b/zellij-server/src/ui/pane_boundaries_frame.rs index 07cae4ac6..28f6112bb 100644 --- a/zellij-server/src/ui/pane_boundaries_frame.rs +++ b/zellij-server/src/ui/pane_boundaries_frame.rs @@ -2,8 +2,8 @@ use crate::output::CharacterChunk; use crate::panes::{AnsiCode, CharacterStyles, TerminalCharacter, EMPTY_TERMINAL_CHARACTER}; use crate::ui::boundaries::boundary_type; use crate::ClientId; +use zellij_utils::pane_size::Viewport; use zellij_utils::zellij_tile::prelude::{client_id_to_colors, Palette, PaletteColor}; -use zellij_utils::{envs::get_session_name, pane_size::Viewport}; use unicode_width::{UnicodeWidthChar, UnicodeWidthStr}; @@ -603,15 +603,6 @@ impl PaneFrame { character_chunks.push(CharacterChunk::new(boundary_character_right, x, y)); } } - let vte_output = if self.is_main_client { - Some(format!( - "\u{1b}]0;Zellij ({}) - {}\u{07}", - get_session_name().unwrap(), - self.title - )) - } else { - None - }; - (character_chunks, vte_output) + (character_chunks, None) } } diff --git a/zellij-server/src/ui/pane_contents_and_ui.rs b/zellij-server/src/ui/pane_contents_and_ui.rs index 5e3ee9b9b..61b0e3544 100644 --- a/zellij-server/src/ui/pane_contents_and_ui.rs +++ b/zellij-server/src/ui/pane_contents_and_ui.rs @@ -8,7 +8,6 @@ use std::collections::HashMap; use zellij_tile::data::{ client_id_to_colors, single_client_color, InputMode, Palette, PaletteColor, }; - pub struct PaneContentsAndUi<'a> { pane: &'a mut Box<dyn Pane>, output: &'a mut Output, @@ -111,6 +110,14 @@ impl<'a> PaneContentsAndUi<'a> { } } } + pub fn render_terminal_title_if_needed(&mut self, client_id: ClientId, client_mode: InputMode) { + if !self.focused_clients.contains(&client_id) { + return; + } + let vte_output = self.pane.render_terminal_title(client_mode); + self.output + .add_post_vte_instruction_to_client(client_id, &vte_output); + } pub fn render_pane_frame( &mut self, client_id: ClientId, |