feat: add windows build woooooo (#1)
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 51s

### Explanation

_No response_

### Issue

_No response_

### Attestations

- [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/)
- [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/).
- [x] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/).

### Dependencies

- [ ] I have pinned the dependencies to a specific patch version.

### Style

- [ ] I have run the linter and resolved any errors.
- [ ] My pull request uses an appropriate title, matching the conventional commit standards.
- [ ] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request.

### Tests

- [ ] My contribution adds new code, and I have added tests to cover it.
- [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes.
- [ ] All new and existing tests pass locally with my changes.
- [ ] Code coverage remains at or above the configured threshold.

### Documentation

_No response_

### Versioning

Minor - My pull request introduces a new non-breaking feature.

Reviewed-on: #1
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit was merged in pull request #1.
This commit is contained in:
2026-01-15 10:05:22 -08:00
committed by Naomi Carrigan
parent f393dfb359
commit bd04328e40
3 changed files with 55 additions and 15 deletions
+18 -11
View File
@@ -5,6 +5,9 @@ use std::sync::Arc;
use std::thread;
use tauri::{AppHandle, Emitter};
#[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
use crate::types::{CharacterState, ClaudeMessage, ConnectionStatus, ContentBlock, StateChangeEvent, OutputEvent, PermissionPromptEvent};
const SEARCH_TOOLS: [&str; 5] = ["Read", "Glob", "Grep", "WebSearch", "WebFetch"];
@@ -116,24 +119,28 @@ impl WslBridge {
cmd.current_dir(working_dir);
cmd
} else {
// Running on Windows - use wsl to call claude
// Running on Windows - use wsl with bash login shell to ensure PATH is loaded
eprintln!("[DEBUG] Windows path - using wsl");
let mut cmd = Command::new("wsl");
let mut args = vec![
"--cd".to_string(), working_dir.to_string(),
"--".to_string(), "claude".to_string(),
"--output-format".to_string(), "stream-json".to_string(),
"--input-format".to_string(), "stream-json".to_string(),
"--verbose".to_string(),
];
// Build the claude command with all arguments
let mut claude_cmd = format!(
"cd '{}' && claude --output-format stream-json --input-format stream-json --verbose",
working_dir
);
// Add allowed tools if any
for tool in &allowed_tools {
args.push("--allowedTools".to_string());
args.push(tool.clone());
claude_cmd.push_str(&format!(" --allowedTools '{}'", tool));
}
cmd.args(&args);
// Use bash -lc to load login profile (ensures PATH includes claude)
cmd.args(["-e", "bash", "-lc", &claude_cmd]);
// Hide the console window on Windows
#[cfg(target_os = "windows")]
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
cmd
};