Skip to content

Fix Windows PTY Docker resolution - #6

Merged
jhd3197 merged 1 commit into
mainfrom
dev
Jul 22, 2026
Merged

Fix Windows PTY Docker resolution#6
jhd3197 merged 1 commit into
mainfrom
dev

Conversation

@jhd3197

@jhd3197 jhd3197 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Add a shared docker_program() helper and use it for PTY terminal sessions so Windows resolves docker.exe instead of Docker Desktop's extensionless docker script. This avoids portable-pty launching a non-Win32 executable and fixes terminal startup on Windows.

Add a shared `docker_program()` helper and use it for PTY terminal sessions so Windows resolves `docker.exe` instead of Docker Desktop's extensionless `docker` script. This avoids portable-pty launching a non-Win32 executable and fixes terminal startup on Windows.
Copilot AI review requested due to automatic review settings July 22, 2026 03:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Windows terminal startup by ensuring PTY-launched docker compose exec resolves to docker.exe (not Docker Desktop’s extensionless docker script), avoiding CreateProcessW “not a valid Win32 application” failures when spawning via portable-pty.

Changes:

  • Added a shared crate::docker::docker_program() helper to pick an appropriate Docker CLI executable (with Windows-specific resolution to docker.exe).
  • Updated PTY terminal sessions to use docker_program() when spawning docker compose exec.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src-tauri/src/terminal.rs Use crate::docker::docker_program() when spawning Docker via portable-pty for terminal sessions.
src-tauri/src/docker.rs Introduce docker_program() helper to reliably select docker.exe on Windows (absolute path when found on PATH).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src-tauri/src/docker.rs
Comment on lines +48 to +54
return std::env::var_os("PATH")
.into_iter()
.flat_map(|paths| std::env::split_paths(&paths).collect::<Vec<_>>())
.map(|dir| dir.join("docker.exe"))
.find(|candidate| candidate.is_file())
.map(|path| path.into_os_string())
.unwrap_or_else(|| "docker.exe".into());
@jhd3197
jhd3197 merged commit ebbfee2 into main Jul 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants