From 2929decac291ec0417e198ee3c15ad5732996215 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Tue, 29 Aug 2023 15:58:22 +0200 Subject: [PATCH] debug --- src/commands.rs | 7 +++++++ zellij-client/src/lib.rs | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 5ab188d69f..be3909684a 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -340,6 +340,7 @@ pub(crate) fn start_client(opts: CliArgs) { let layout = layout.clone(); let mut config_options = config_options.clone(); let mut opts = opts.clone(); + let mut debug = false; if let Some(reconnect_to_session) = &reconnect_to_session { // this is integration code to make session reconnects work with this existing, @@ -358,6 +359,7 @@ pub(crate) fn start_client(opts: CliArgs) { opts.session = None; config_options.attach_to_session = None; } + debug = true; } let start_client_plan = |session_name: std::string::String| { @@ -417,6 +419,7 @@ pub(crate) fn start_client(opts: CliArgs) { attach_layout, tab_position_to_focus, pane_id_to_focus, + false, ); } else { if let Some(session_name) = opts.session.clone() { @@ -430,6 +433,7 @@ pub(crate) fn start_client(opts: CliArgs) { Some(layout), None, None, + debug, ); } else { if let Some(session_name) = config_options.session_name.as_ref() { @@ -466,6 +470,7 @@ pub(crate) fn start_client(opts: CliArgs) { attach_layout, None, None, + debug, ); }, _ => { @@ -479,6 +484,7 @@ pub(crate) fn start_client(opts: CliArgs) { Some(layout), None, None, + debug, ); }, } @@ -501,6 +507,7 @@ pub(crate) fn start_client(opts: CliArgs) { Some(layout), None, None, + debug, ); } } diff --git a/zellij-client/src/lib.rs b/zellij-client/src/lib.rs index 8dbae4f0ab..2c5be2cc57 100644 --- a/zellij-client/src/lib.rs +++ b/zellij-client/src/lib.rs @@ -147,6 +147,7 @@ pub fn start_client( layout: Option, tab_position_to_focus: Option, pane_id_to_focus: Option<(u32, bool)>, // (pane_id, is_plugin) + debug: bool, ) -> Option { info!("Starting Zellij client!"); @@ -156,14 +157,16 @@ pub fn start_client( let bracketed_paste = "\u{1b}[?2004h"; os_input.unset_raw_mode(0).unwrap(); - let _ = os_input - .get_stdout_writer() - .write(take_snapshot.as_bytes()) - .unwrap(); - let _ = os_input - .get_stdout_writer() - .write(clear_client_terminal_attributes.as_bytes()) - .unwrap(); + if debug { + let _ = os_input + .get_stdout_writer() + .write(take_snapshot.as_bytes()) + .unwrap(); + let _ = os_input + .get_stdout_writer() + .write(clear_client_terminal_attributes.as_bytes()) + .unwrap(); + } envs::set_zellij("0".to_string()); config.env.set_vars(); @@ -172,6 +175,7 @@ pub fn start_client( .unwrap_or_else(|| os_input.load_palette()); let full_screen_ws = os_input.get_terminal_size_using_fd(0); + log::info!("full_screen_ws: {:?}", full_screen_ws); let client_attributes = ClientAttributes { size: full_screen_ws, style: Style {