Skip to content

Unable to Exit OpenCode TUI When Configuration Errors Occur #4245

@Hipfox

Description

@Hipfox

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions