OpenCode hangs when working directory has trailing space in name #6514

Open
opened 2026-02-16 18:04:26 -05:00 by yindo · 2 comments
Owner

Originally created by @jmhunter83 on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

OpenCode fails to respond when run from a directory with a trailing space in its name (e.g., "Baseball " instead of "Baseball").

Steps to reproduce

  1. Create a directory with a trailing space: mkdir "TestDir "
  2. cd "TestDir "
  3. Run opencode
  4. Try to interact - no response

Expected behavior

OpenCode should either work normally or display an error about invalid path characters.

Actual behavior

OpenCode appears to hang with no output or error message.

Environment

  • Version: 1.1.23
  • OS: macOS Tahoe 26.2 (Darwin 25.2.0)

Workaround

Rename directory to remove trailing space: mv "TestDir " "TestDir"

Originally created by @jmhunter83 on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description OpenCode fails to respond when run from a directory with a trailing space in its name (e.g., `"Baseball "` instead of `"Baseball"`). ## Steps to reproduce 1. Create a directory with a trailing space: `mkdir "TestDir "` 2. `cd "TestDir "` 3. Run `opencode` 4. Try to interact - no response ## Expected behavior OpenCode should either work normally or display an error about invalid path characters. ## Actual behavior OpenCode appears to hang with no output or error message. ## Environment - **Version**: 1.1.23 - **OS**: macOS Tahoe 26.2 (Darwin 25.2.0) ## Workaround Rename directory to remove trailing space: `mv "TestDir " "TestDir"`
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

This issue might be related to several existing hanging/freezing issues in OpenCode, though none appear to specifically address trailing spaces in directory names:

  • #8707: CLI hangs on macOS with daemon initialization failure
  • #8406: Connection hangs with non-standard HTTP/SSE servers
  • #8415: Connection hangs over Tailscale SSH
  • #8002: OpenCode hangs mid-stream on unstable internet connections
  • #7843: Deadlock on second run in ARM64/Proot environments

The trailing space issue may be worth investigating in the path/directory handling code to ensure special whitespace characters are properly handled during initialization. Consider checking error handling in working directory resolution and initialization routines.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be related to several existing hanging/freezing issues in OpenCode, though none appear to specifically address trailing spaces in directory names: - #8707: CLI hangs on macOS with daemon initialization failure - #8406: Connection hangs with non-standard HTTP/SSE servers - #8415: Connection hangs over Tailscale SSH - #8002: OpenCode hangs mid-stream on unstable internet connections - #7843: Deadlock on second run in ARM64/Proot environments The trailing space issue may be worth investigating in the path/directory handling code to ensure special whitespace characters are properly handled during initialization. Consider checking error handling in working directory resolution and initialization routines.
Author
Owner

@jmhunter83 commented on GitHub (Jan 16, 2026):

reviewed GH suggestions, this appears to be a unique, new bug.

@jmhunter83 commented on GitHub (Jan 16, 2026): reviewed GH suggestions, this appears to be a unique, new bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6514