Skip to content

Opencode is able to crash the terminal #3691

Closed

Description

@NSPC911

Description

Okay, I genuinely have no clue what and how this is happening.

If you run opencode, then press Ctrl+c, opencode closes, then it closes the shell tab itself. How does this even happen???

OpenCode version

v1.0.7

Steps to reproduce

  1. Launch Opencode
  2. Press Ctrl+c

Screenshot and/or share link

2025-11-01.20-48-25.mp4

Operating System

Windows 11 (it may not look like it, but it is)

Terminal

Wezterm, Rio, Alacritty, Tabby and Windows Terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 1, 2025
  2. NSPC911 commented on Nov 1, 2025

    @NSPC911
    ContributorAuthor

    my config: opencode.json and AGENTS.md

  3. veracioux commented on Nov 1, 2025

    @veracioux
    Contributor

    @NSPC911 What if you disable wezterm-mcp?

      "mcp": {
        "wezterm-mcp": {
          "type": "local",
          "command": ["npx", "-y", "wezterm-mcp"],
          "enabled": false
        }
      }
    
  4. NSPC911 commented on Nov 1, 2025

    @NSPC911
    ContributorAuthor

    @NSPC911 What if you disable wezterm-mcp?

      "mcp": {
        "wezterm-mcp": {
          "type": "local",
          "command": ["npx", "-y", "wezterm-mcp"],
          "enabled": false
        }
      }
    

    no difference, it still crashes it

    but as I showed, it crashed on rio, alacrity and tabby, but not on windows terminal

  5. veracioux commented on Nov 1, 2025

    @veracioux
    Contributor

    @NSPC911 I was aware, my thinking was that it interacts with the terminal in some unorthodox way. This issue is so weird...

    Some other things to try:

    • You are sure opencode is the command opencode and not some shell function/alias?
    • From what I see, you are running PowerShell every time. Are you able to try running any other shell and then opencode within it?
  6. thdxr commented on Nov 1, 2025

    @thdxr
    Member

    what happens if you exit with /exit

  7. NSPC911 commented on Nov 1, 2025

    @NSPC911
    ContributorAuthor
    2025-11-02.00-08-03.mp4

    @veracioux @thdxr

    /exit doesn't seem to exist anyway

  8. thdxr commented on Nov 1, 2025

    @thdxr
    Member

    sorry just merged that will release soon

  9. NSPC911 commented on Nov 2, 2025

    @NSPC911
    ContributorAuthor
  10. NSPC911 commented on Nov 19, 2025

    @NSPC911
    ContributorAuthor

    Update to this wonderfully weird bug:

    This is resolved in Alacritty, Rio and Tabby, but the cursors persist to be based on the theme used.

    The issue is still not resolved in Wezterm.

  11. veracioux commented on Nov 19, 2025

    @veracioux
    Contributor

    Any idea what caused/what fixed it for those terminals?

  12. NSPC911 commented on Nov 19, 2025

    @NSPC911
    ContributorAuthor

    Funny enough, I don't know which release fixed the issues, I mainly used only Wezterm, but today, I wanted to show this weird bug to my friend, when it suddenly worked

  13. rekram1-node commented on Nov 19, 2025

    @rekram1-node
    Collaborator

    guess we will close for now then

  14. NSPC911 commented on Feb 11, 2026

    @NSPC911
    ContributorAuthor

    @branskugel I saw your message in #631 (comment) , is this something related maybe?

  15. Nivarrym commented on Feb 11, 2026

    @Nivarrym

    @Branskugel I saw your message in #631 (comment) , is this something related maybe?

    Hi! Not sure... It does exit sort of normally with "ctrl+c". "Sort of" because after one use of the hotkey opencode exits back to the command prompt of the shell, but doesn't allow input as if the process is still active, so I have to press the shortcut again and then wezterm gets fully back to normal. While using '/exit' command in user prompt of opencode hangs wezterm's open pane completely. Couple opencode releases back it also resulted in opencode.exe staying active in the task manager even after exiting, most recent release seems to have fixed at least that, but the weird exit code problem still remains. Using opencode from pure powershell (7) or cmd works normally though.

  16. NSPC911 commented on Feb 11, 2026

    @NSPC911
    ContributorAuthor

    What do you mean by Pure Powershell, do you mean Powershell 5 that comes with all Windows releases?

  17. Nivarrym commented on Feb 11, 2026

    @Nivarrym

    What do you mean by Pure Powershell, do you mean Powershell 5 that comes with all Windows releases?

    No, no, I mean powershell 7, the pwsh one, which you install manually, that's why I put 7 in the parentheses. By 'pure' i rather mean from default windows terminal or windows terminal preview

  18. NSPC911 commented on Feb 11, 2026

    @NSPC911
    ContributorAuthor

    Yeah I don't know why, but only wezterm has this issue. I think I stated it before already, this issue never occurred on Windows Terminal, but recent releases seemed to have fixed it for everything except wezterm, which sucks, because I want the cross platform config :/

  19. NSPC911 commented on Feb 11, 2026

    @NSPC911
    ContributorAuthor

    In the recent versions however, I noticed that /exit does actually quit properly and shows the session ID, so it does mean it is able to exit properly. However, pressing Ctrl + C just freezes it or something.

    Hoping https://x.com/LukeParkerDev/status/2021413272969498814 is able to fix it (or not, because the showcase uses Windows Terminal)

    @rekram1-node could you maybe raise this up to Luke? (didn't want to directly ping @Hona because I think I might be wrong)

  20. Hona commented on Feb 11, 2026

    @Hona
    Member

    Yes - my stuff in beta/tweet should fix this. I'll close the loop when it's in a stable release

  21. pjeby commented on Mar 5, 2026

    @pjeby

    Just as an FYI, if you're experiencing this issue with Windows Terminal, there's a fix that's in the preview version currently. Should be in the 1.25 standard release, but only available in 1.24 preview at the moment.

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 workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions