You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Desktop embedded terminal freezes when shell exits via Ctrl+D or exit command #6004
The embedded terminal in the bottom panel of OpenCode Desktop freezes/hangs when the shell session terminates, either by pressing Ctrl+D or typing exit.
I don't use the Desktop or Web version regularly, so I haven't investigated this deeply. I encountered this bug on my first time trying the Desktop app.
Additional observation: In opencode web, the terminal panel failed to open entirely (this might be related to issue #5844).
OpenCode version
v1.0.190
Steps to reproduce
Open OpenCode Desktop (Tauri app) or run opencode web
Open a project
Open the terminal panel (bottom sidebar)
Either:
Press Ctrl+D to send EOF, OR
Type exit and press Enter
The application freezes/hangs
Expected behavior
The terminal should gracefully handle shell exit by either:
Closing the terminal panel
Showing a "Terminal exited" message with option to restart
Automatically spawning a new shell session
Actual behavior
Tauri Desktop: Application freezes after shell exits
opencode web: Terminal panel doesn't open at all
Operating System
macOS (Apple Silicon M4 - MacBook Air)
Terminal
Default shell
Preliminary investigation (with LLM assistance)
A superficial analysis of the codebase suggests the issue may be related to a disconnect between backend PTY cleanup and frontend handling:
The root cause may be related to PTY cleanup and websocket connection handling when the shell exits, as you've already noted in your investigation. Feel free to ignore if none of these address your specific case.
Thanks for the suggestions! After reviewing, I don't believe these are duplicates:
Bun crash when /exiting #5896 (Bun crash when /exiting): That issue is about a Bun crash when using the /exit command in the CLI/TUI. This issue is about the embedded terminal (Ghostty) in the Desktop bottom panel freezing when the shell exits via Ctrl+D or the shell's exit command.
Random Artifactts In Terminal After Running #5936 (Random Artifacts In Terminal After Running): That issue is about visual artifacts in the terminal on Windows after closing OpenCode TUI. This issue is specifically about the Desktop app freezing, not visual glitches.
Bug: opencode run and TUI exits hang on v0.15+ #3213 (opencode run and TUI exits hang): That issue is about the CLI mode (opencode run) and TUI hanging. This issue is specific to the Desktop (Tauri) and opencode web embedded terminal panel.
The key distinction is that this bug occurs in the Desktop/Web embedded terminal component, not in the CLI/TUI.
Activity
github-actions commentedon Dec 23, 2025
This issue might be a duplicate of existing issues. Please check:
/exiting #5896: Bun crash when/exiting - Similar exit-related crash issueopencode runand TUI exits hang on v0.15+ #3213: Bug:opencode runand TUI exits hang on v0.15+ - Regression related to process not exiting properlyThe root cause may be related to PTY cleanup and websocket connection handling when the shell exits, as you've already noted in your investigation. Feel free to ignore if none of these address your specific case.
anntnzrb commentedon Dec 23, 2025
Thanks for the suggestions! After reviewing, I don't believe these are duplicates:
Bun crash when
/exiting #5896 (Bun crash when/exiting): That issue is about a Bun crash when using the/exitcommand in the CLI/TUI. This issue is about the embedded terminal (Ghostty) in the Desktop bottom panel freezing when the shell exits viaCtrl+Dor the shell'sexitcommand.Random Artifactts In Terminal After Running #5936 (Random Artifacts In Terminal After Running): That issue is about visual artifacts in the terminal on Windows after closing OpenCode TUI. This issue is specifically about the Desktop app freezing, not visual glitches.
Bug:
opencode runand TUI exits hang on v0.15+ #3213 (opencode runand TUI exits hang): That issue is about the CLI mode (opencode run) and TUI hanging. This issue is specific to the Desktop (Tauri) andopencode webembedded terminal panel.The key distinction is that this bug occurs in the Desktop/Web embedded terminal component, not in the CLI/TUI.
AlexandrosLiaskos commentedon Dec 23, 2025
For me the terminal never opens. In wsl the deb worked, but in windows app, both the stable and beta didn't even open a terminal