fix: shell command execution briefly flashes a terminal window on Windows #165

Closed
opened 2026-02-25 10:29:13 -08:00 by hikari · 0 comments
Owner

Description

Several features — including desktop notifications, MCP server list fetching, and opening files in the system editor — briefly flash a terminal/command prompt window before it immediately disappears. This is visually jarring and looks broken to users.

Affected Features

  • Desktop notifications (likely via PowerShell on Windows)
  • MCP server list operations
  • Opening files externally

Root Cause

On Windows, spawning a child process via std::process::Command defaults to creating a visible console window. The fix is to pass the CREATE_NO_WINDOW creation flag when spawning processes on Windows, which suppresses the console window entirely.

Proposed Fix

Use the windows crate or raw PROCESS_CREATION_FLAGS to set CREATE_NO_WINDOW (value 0x08000000) when building commands on Windows:

#[cfg(windows)]
{
    use std::os::windows::process::CommandExt;
    command.creation_flags(0x08000000); // CREATE_NO_WINDOW
}

This should be applied to all Command::new(...) spawns that are not expected to have user-visible terminal output.

This issue was created with help from Hikari~ 🌸

## Description Several features — including desktop notifications, MCP server list fetching, and opening files in the system editor — briefly flash a terminal/command prompt window before it immediately disappears. This is visually jarring and looks broken to users. ## Affected Features - Desktop notifications (likely via PowerShell on Windows) - MCP server list operations - Opening files externally ## Root Cause On Windows, spawning a child process via `std::process::Command` defaults to creating a visible console window. The fix is to pass the `CREATE_NO_WINDOW` creation flag when spawning processes on Windows, which suppresses the console window entirely. ## Proposed Fix Use the `windows` crate or raw `PROCESS_CREATION_FLAGS` to set `CREATE_NO_WINDOW` (value `0x08000000`) when building commands on Windows: ```rust #[cfg(windows)] { use std::os::windows::process::CommandExt; command.creation_flags(0x08000000); // CREATE_NO_WINDOW } ``` This should be applied to all `Command::new(...)` spawns that are not expected to have user-visible terminal output. ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-02-25 22:55:48 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#165