fix: respect --headed false flag in CLI (#757)

When user explicitly sets --headed false, the CLI was ignoring this
flag because the launch condition only checked if flags.headed was
true. This meant that --headed false would not trigger a launch
command, and subsequent commands would auto-launch with default
headless=true.

The fix adds a cli_headed flag to track when the user explicitly
sets --headed (regardless of value), and includes this in the
launch condition check.

Fixes #743
This commit is contained in:
QuietyAwe
2026-03-13 09:42:59 -05:00
committed by GitHub
parent e02bc1a10c
commit ea9d456341
3 changed files with 6 additions and 0 deletions
+3
View File
@@ -267,6 +267,7 @@ pub struct Flags {
pub cli_annotate: bool,
pub cli_download_path: bool,
pub cli_native: bool,
pub cli_headed: bool,
}
pub fn parse_flags(args: &[String]) -> Flags {
@@ -382,6 +383,7 @@ pub fn parse_flags(args: &[String]) -> Flags {
cli_annotate: false,
cli_download_path: false,
cli_native: false,
cli_headed: false,
};
let mut i = 0;
@@ -404,6 +406,7 @@ pub fn parse_flags(args: &[String]) -> Flags {
"--headed" => {
let (val, consumed) = parse_bool_arg(args, i);
flags.headed = val;
flags.cli_headed = true;
if consumed {
i += 1;
}