Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions src/commands/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,30 @@ pub fn handle_login(_args: &[String]) {
/// Attempt to open a URL in the system's default browser
fn open_browser(url: &str) -> Result<(), String> {
#[cfg(target_os = "macos")]
{
std::process::Command::new("open")
.arg(url)
.spawn()
.map_err(|e| e.to_string())?;
}
let mut cmd = {
let mut cmd = std::process::Command::new("open");
cmd.arg(url);
cmd
};

#[cfg(target_os = "linux")]
{
std::process::Command::new("xdg-open")
.arg(url)
.spawn()
.map_err(|e| e.to_string())?;
}
let mut cmd = {
let mut cmd = std::process::Command::new("xdg-open");
cmd.arg(url);
cmd
};

#[cfg(target_os = "windows")]
{
std::process::Command::new("cmd")
.args(["/C", "start", "", url])
.spawn()
.map_err(|e| e.to_string())?;
}
let mut cmd = {
let mut cmd = std::process::Command::new("cmd");
cmd.args(["/C", "start", "", url]);
cmd
};

cmd.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.spawn()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed — reverted to .spawn() (non-blocking, fire-and-forget) while keeping the Stdio::null() redirects to suppress xdg-open error spam. This preserves the original non-blocking behavior so token polling starts immediately.

.map_err(|e| e.to_string())?;

Ok(())
}
Loading