-
Notifications
You must be signed in to change notification settings - Fork 537
Description
Bug Description
When quitting Hyprnote Nightly, it kills any process containing "stt" in its name, not just its own sidecar process. This causes unintended termination of applications like Ghostty terminal.
Root Cause
The process cleanup logic in crates/host/src/lib.rs uses substring matching (contains("stt")), which matches unrelated processes:
// Current problematic code (lines 25-45)
if process_name.contains(&target) && process.kill() {
killed_count += 1;
}This matches:
- ✅ Intended:
stt(Hyprnote's speech-to-text server) - ❌ Unintended:
ghostty(user's terminal application)
Reproduction Steps
- Launch Ghostty terminal (
/Applications/Ghostty.app) - Launch Hyprnote Nightly (
/Applications/Hyprnote Nightly.app) - Quit Hyprnote Nightly (Cmd+Q or via tray menu)
- Observe: Ghostty also quits unexpectedly
Expected Behavior
Only Hyprnote's own sidecar process (stt) should be terminated.
Actual Behavior
All processes with "stt" substring in their name are killed.
Affected Code Locations
crates/host/src/lib.rs(lines 25-45) - Core kill logicapps/desktop/src-tauri/src/lib.rs:208- Main exit handlerplugins/tray/src/menu_items/tray_quit.rs:19- Tray quit handlerplugins/local-stt/src/server/external.rs:98- STT cleanup
Suggested Solutions
Option 1: Exact Name Match (Quick Fix)
// Change line ~40 from:
if process_name.contains(&target) && process.kill() {
// To:
if process_name == target && process.kill() {Option 2: Parent-Child Relationship (Robust)
let is_child = process.parent().map_or(false, |ppid| {
ppid.as_u32() == current_pid
});
if process_name.contains(&target) && is_child && process.kill() {
killed_count += 1;
}Option 3: PID-Based Tracking (Best Practice)
Store the sidecar PID when spawning and kill by exact PID instead of name matching.
Environment
- OS: macOS (Darwin 25.2.0)
- Application: Hyprnote Nightly
- Affected Apps: Ghostty terminal (and potentially any app with "stt" in the name)
Impact
Severity: High - Causes unexpected termination of unrelated user applications, leading to data loss in affected apps.
Additional Context
The issue affects any process with "stt" in its name. Other potentially affected applications could include:
- Custom scripts/tools with "stt" in filename
- Other speech-to-text applications
- Network testing tools (netstat derivatives)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status