Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif committed Aug 29, 2023
1 parent 24ce348 commit 2929dec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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| {
Expand Down Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down Expand Up @@ -466,6 +470,7 @@ pub(crate) fn start_client(opts: CliArgs) {
attach_layout,
None,
None,
debug,
);
},
_ => {
Expand All @@ -479,6 +484,7 @@ pub(crate) fn start_client(opts: CliArgs) {
Some(layout),
None,
None,
debug,
);
},
}
Expand All @@ -501,6 +507,7 @@ pub(crate) fn start_client(opts: CliArgs) {
Some(layout),
None,
None,
debug,
);
}
}
Expand Down
20 changes: 12 additions & 8 deletions zellij-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ pub fn start_client(
layout: Option<Layout>,
tab_position_to_focus: Option<usize>,
pane_id_to_focus: Option<(u32, bool)>, // (pane_id, is_plugin)
debug: bool,
) -> Option<ConnectToSession> {
info!("Starting Zellij client!");

Expand All @@ -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();

Expand All @@ -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 {
Expand Down

0 comments on commit 2929dec

Please sign in to comment.