Skip to content

[Windows Desktop] New Terminal always fails with PTY spawn failed (across multiple versions) #24463

Closed

Description

@liu5269

Description

Summary

On Windows, OpenCode Desktop can launch normally, but creating a new terminal always fails.
Logs repeatedly show: service=server error=PTY spawn failed.

Environment

  • OS: Windows 11 (10.0.26200)
  • Desktop app channel: winget package SST.OpenCodeDesktop
  • Versions tested:
    • 1.14.25
    • 1.14.20
    • 1.14.19
  • Project paths tested:
    • E:\opencode
    • H:\opencode

Expected behavior

Clicking New Terminal should open a functional terminal tab.

Actual behavior

No terminal opens. Desktop log repeatedly outputs:
service=server error=PTY spawn failed

Reproduction steps

  1. Start OpenCode Desktop on Windows.
  2. Open a workspace/project.
  3. Click New Terminal.
  4. Observe failure (no terminal tab created).
  5. Check logs under:
    C:\Users\Administrator\AppData\Local\ai.opencode.desktop\logs\

Log evidence

Latest reproduced log:

  • C:\Users\Administrator\AppData\Local\ai.opencode.desktop\logs\opencode-desktop_2026-04-26_17-56-11.log
    Key lines (example):
  • Spawning sidecar on http://127.0.0.1:64872
  • No CLI installation found, skipping sync
  • ERROR ... service=server error=PTY spawn failed failed (repeated many times)
    Issue reproduces similarly in:
  • ..._17-19-14.log
  • ..._17-16-36.log
  • ..._17-14-42.log
  • ..._17-12-58.log
  • ..._17-09-24.log

Troubleshooting already performed

I have already done all of the following, with no effect:

  1. Config cleanup
    • Removed unsupported/invalid config keys and bad plugin entries.
  2. Desktop state reset
    • Reset opencode.workspace*.dat
    • Reset opencode.settings.dat and opencode.global.dat (with backup)
  3. Environment variable cleanup
    • Removed custom SHELL/terminal overrides.
  4. Version rollback tests
    • 1.14.25 -> 1.14.20 -> 1.14.19
    • Same PTY spawn failed behavior in all versions.
  5. System integrity repair
    • sfc /scannow (found and repaired corrupted files)
    • DISM /Online /Cleanup-Image /RestoreHealth (successful)
    • Full reboot afterwards.
  6. Re-test after reboot
    • Still fails identically.

Why this seems like a product bug

  • Reproducible across multiple versions.
  • Not tied to a single project config.
  • Persists after desktop state reset and OS integrity repair.
  • Failure happens specifically in Desktop terminal PTY creation path.

Related issues possibly relevant

Plugins

oh my opencode

OpenCode version

1.14.25

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

windows11

Terminal

Windows Terminal

Activity

  1. github-actions commented on Apr 26, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from these, please add details explaining the difference so maintainers can prioritize accordingly.

  2. liu5269 commented on Apr 26, 2026

    @liu5269
    Author
    Image
  3. prasadf18 commented on Apr 27, 2026

    @prasadf18

    @rekram1-node hi, please assign this to me

  4. liu5269 commented on Apr 29, 2026

    @liu5269
    Author

    Here is an English version:


    On Windows, if the user environment registry contains bad entries, the assembled environment block can cause CreateProcessW to fail with ERROR_INVALID_PARAMETER (87). Logging for this path should be more detailed so it is easier to see what went wrong—especially when the problem comes from system environment variables.

    The fix was to remove these four bad values under the user environment key:

    reg delete "HKCU\Environment" /v DriverArcL /f
    reg delete "HKCU\Environment" /v DriverAnoD /f
    reg delete "HKCU\Environment" /v DriverAnoM /f
    reg delete "HKCU\Environment" /v XiuMaster_v1_button_hotkey /f

    After deleting those entries, the embedded terminal worked again.


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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktopwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions