Unable to Exit OpenCode TUI When Configuration Errors Occur #2805

Closed
opened 2026-02-16 17:37:19 -05:00 by yindo · 2 comments
Owner

Originally created by @Hipfox on GitHub (Nov 12, 2025).

Description

When OpenCode encounters a command or agent configuration error during startup, the TUI displays the error message but becomes unresponsive to normal exit commands. Users are unable to exit the application using standard methods and must resort to killing the process manually.

OpenCode version

1.0.61

Steps to reproduce

Create an invalid configuration in directory with incorrect command/agent settings
Launch OpenCode TUI with opencode
Observe that an error message is displayed
Attempt to exit using normal methods:
    /exit, /quit, or /q commands
    Ctrl+C interrupt
Notice that none of these methods work

Expected Behavior

When a configuration error occurs, OpenCode should either:

Validate configuration before launching the TUI and exit at the CLI level with an error message
Provide a functional exit mechanism even when in an error state
Respond to standard interrupt signals like Ctrl+C

Actual Behavior

The TUI enters an error state where it displays the configuration error but does not respond to any exit commands or keybindings. The terminal is taken over by the TUI, but the error handling logic does not provide a way to exit gracefully.

Workaround

Users must manually kill the OpenCode process:

kill <opencode-pid>

Suggested Fix

Consider adding early configuration validation before TUI initialization, or ensure that exit commands remain functional even when the application is in an error state.

Screenshot and/or share link

No response

Operating System

VM: Arch Linux(OpenCode 1.0.61)

Terminal

Host:Windows(Windows Terminal Version: 1.23.12811.0)

Originally created by @Hipfox on GitHub (Nov 12, 2025). ### Description When OpenCode encounters a command or agent configuration error during startup, the TUI displays the error message but becomes unresponsive to normal exit commands. Users are unable to exit the application using standard methods and must resort to killing the process manually. ### OpenCode version 1.0.61 ### Steps to reproduce Create an invalid configuration in directory with incorrect command/agent settings Launch OpenCode TUI with opencode Observe that an error message is displayed Attempt to exit using normal methods: /exit, /quit, or /q commands Ctrl+C interrupt Notice that none of these methods work **Expected Behavior** When a configuration error occurs, OpenCode should either: Validate configuration before launching the TUI and exit at the CLI level with an error message Provide a functional exit mechanism even when in an error state Respond to standard interrupt signals like Ctrl+C **Actual Behavior** The TUI enters an error state where it displays the configuration error but does not respond to any exit commands or keybindings. The terminal is taken over by the TUI, but the error handling logic does not provide a way to exit gracefully. **Workaround** Users must manually kill the OpenCode process: `kill <opencode-pid>` **Suggested Fix** Consider adding early configuration validation before TUI initialization, or ensure that exit commands remain functional even when the application is in an error state. ### Screenshot and/or share link _No response_ ### Operating System VM: Arch Linux(OpenCode 1.0.61) ### Terminal Host:Windows(Windows Terminal Version: 1.23.12811.0)
yindo added the opentuibug labels 2026-02-16 17:37:19 -05:00
yindo closed this issue 2026-02-16 17:37:19 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 12, 2025):

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

  • #3213: Similar TUI exit problems where /exit and Ctrl+C don't properly return control to shell, requiring manual process termination
  • #3846: TUI becomes completely unresponsive to user input including Ctrl+C and ESC, requiring process kill (also opentui related, v1.0.15)
  • #2512: Similar unresponsive behavior where multiple Ctrl+C presses are needed to exit properly
  • #4073: ESC stops responding and shows similar hanging behavior during error states

The common pattern across these issues is TUI becoming unresponsive to standard exit commands when in error states, requiring manual process termination.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 12, 2025): This issue might be a duplicate of existing issues. Please check: - #3213: Similar TUI exit problems where /exit and Ctrl+C don't properly return control to shell, requiring manual process termination - #3846: TUI becomes completely unresponsive to user input including Ctrl+C and ESC, requiring process kill (also opentui related, v1.0.15) - #2512: Similar unresponsive behavior where multiple Ctrl+C presses are needed to exit properly - #4073: ESC stops responding and shows similar hanging behavior during error states The common pattern across these issues is TUI becoming unresponsive to standard exit commands when in error states, requiring manual process termination. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 12, 2025):

Your issue was made first but the newer one has more activity so im just gonna close this one and use the other one: #4246

@rekram1-node commented on GitHub (Nov 12, 2025): Your issue was made first but the newer one has more activity so im just gonna close this one and use the other one: #4246
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2805