From bb0dad86f81768c8b7d5894acf7cd53bd05d302b Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 8 May 2026 15:37:01 +0300 Subject: fix: split panes in target tab without stealing focus fixes #75 --- src/cli.rs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 1260ee6f..dcc2537c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -475,7 +475,7 @@ fn workspace_list(args: &[String]) -> std::io::Result { fn workspace_create(args: &[String]) -> std::io::Result { let mut cwd = None; - let mut focus = true; + let mut focus = false; let mut label = None; let mut index = 0; @@ -497,6 +497,10 @@ fn workspace_create(args: &[String]) -> std::io::Result { label = Some(value.clone()); index += 2; } + "--focus" => { + focus = true; + index += 1; + } "--no-focus" => { focus = false; index += 1; @@ -613,7 +617,7 @@ fn tab_list(args: &[String]) -> std::io::Result { fn tab_create(args: &[String]) -> std::io::Result { let mut workspace_id = None; let mut cwd = None; - let mut focus = true; + let mut focus = false; let mut label = None; let mut index = 0; @@ -643,6 +647,10 @@ fn tab_create(args: &[String]) -> std::io::Result { label = Some(value.clone()); index += 2; } + "--focus" => { + focus = true; + index += 1; + } "--no-focus" => { focus = false; index += 1; @@ -844,7 +852,7 @@ fn pane_read(args: &[String]) -> std::io::Result { fn pane_split(args: &[String]) -> std::io::Result { let Some(raw_pane_id) = args.first() else { eprintln!( - "usage: herdr pane split --direction right|down [--cwd PATH] [--no-focus]" + "usage: herdr pane split --direction right|down [--cwd PATH] [--focus] [--no-focus]" ); return Ok(2); }; @@ -852,7 +860,7 @@ fn pane_split(args: &[String]) -> std::io::Result { let pane_id = normalize_pane_id(raw_pane_id); let mut direction = None; let mut cwd = None; - let mut focus = true; + let mut focus = false; let mut index = 1; while index < args.len() { @@ -873,6 +881,10 @@ fn pane_split(args: &[String]) -> std::io::Result { cwd = Some(value.clone()); index += 2; } + "--focus" => { + focus = true; + index += 1; + } "--no-focus" => { focus = false; index += 1; @@ -1403,7 +1415,7 @@ fn print_status_help() { fn print_workspace_help() { eprintln!("herdr workspace commands:"); eprintln!(" herdr workspace list"); - eprintln!(" herdr workspace create [--cwd PATH] [--label TEXT] [--no-focus]"); + eprintln!(" herdr workspace create [--cwd PATH] [--label TEXT] [--focus] [--no-focus]"); eprintln!(" herdr workspace get "); eprintln!(" herdr workspace focus "); eprintln!(" herdr workspace rename