Skip to content

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

Closed

Description

@jmhunter83

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"

Activity

  1. github-actions commented on Jan 16, 2026

    @github-actions
    Contributor

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

    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.

  2. jmhunter83 commented on Jan 16, 2026

    @jmhunter83
    Author

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

  3. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions