Opencode is able to crash the terminal #2444

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

Originally created by @NSPC911 on GitHub (Nov 1, 2025).

Originally assigned to: @thdxr on GitHub.

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

https://github.com/user-attachments/assets/28c8578e-abc5-4aa9-8f1e-9e02bb2e0577

Operating System

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

Terminal

Wezterm, Rio, Alacritty, Tabby and Windows Terminal

Originally created by @NSPC911 on GitHub (Nov 1, 2025). Originally assigned to: @thdxr on GitHub. ### Description Okay, I genuinely have no clue what and how this is happening. If you run opencode, then press <kbd>Ctrl+c</kbd>, 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 <kbd>Ctrl+c</kbd> ### Screenshot and/or share link https://github.com/user-attachments/assets/28c8578e-abc5-4aa9-8f1e-9e02bb2e0577 ### Operating System Windows 11 (it may not look like it, but it is) ### Terminal Wezterm, Rio, Alacritty, Tabby and Windows Terminal
yindo added the opentuibug labels 2026-02-16 17:35:40 -05:00
yindo closed this issue 2026-02-16 17:35:40 -05:00
Author
Owner

@NSPC911 commented on GitHub (Nov 1, 2025):

my config: opencode.json and AGENTS.md

@NSPC911 commented on GitHub (Nov 1, 2025): my config: [opencode.json](https://github.com/NSPC911/dotfiles/blob/main/dot_config/opencode/opencode.json) and [AGENTS.md](https://github.com/NSPC911/dotfiles/blob/main/dot_config/opencode/AGENTS.md)
Author
Owner

@veracioux commented on GitHub (Nov 1, 2025):

@NSPC911 What if you disable wezterm-mcp?

  "mcp": {
    "wezterm-mcp": {
      "type": "local",
      "command": ["npx", "-y", "wezterm-mcp"],
      "enabled": false
    }
  }
@veracioux commented on GitHub (Nov 1, 2025): @NSPC911 What if you disable wezterm-mcp? ``` "mcp": { "wezterm-mcp": { "type": "local", "command": ["npx", "-y", "wezterm-mcp"], "enabled": false } } ```
Author
Owner

@NSPC911 commented on GitHub (Nov 1, 2025):

@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

@NSPC911 commented on GitHub (Nov 1, 2025): > [@NSPC911](https://github.com/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
Author
Owner

@veracioux commented on GitHub (Nov 1, 2025):

@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?
@veracioux commented on GitHub (Nov 1, 2025): @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?
Author
Owner

@thdxr commented on GitHub (Nov 1, 2025):

what happens if you exit with /exit

@thdxr commented on GitHub (Nov 1, 2025): what happens if you exit with `/exit`
Author
Owner

@NSPC911 commented on GitHub (Nov 1, 2025):

https://github.com/user-attachments/assets/24d976fe-fbc6-4247-9aeb-21cc23201c7a

@veracioux @thdxr

/exit doesn't seem to exist anyway

@NSPC911 commented on GitHub (Nov 1, 2025): https://github.com/user-attachments/assets/24d976fe-fbc6-4247-9aeb-21cc23201c7a @veracioux @thdxr `/exit` doesn't seem to exist anyway
Author
Owner

@thdxr commented on GitHub (Nov 1, 2025):

sorry just merged that will release soon

@thdxr commented on GitHub (Nov 1, 2025): sorry just merged that will release soon
Author
Owner

@NSPC911 commented on GitHub (Nov 1, 2025):

https://github.com/user-attachments/assets/1bf811de-d2bc-4a1e-9ede-d54c0105aa46
@thdxr the same thing still happens

@NSPC911 commented on GitHub (Nov 1, 2025): https://github.com/user-attachments/assets/1bf811de-d2bc-4a1e-9ede-d54c0105aa46 @thdxr the same thing still happens
Author
Owner

@NSPC911 commented on GitHub (Nov 19, 2025):

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.

@NSPC911 commented on GitHub (Nov 19, 2025): 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.
Author
Owner

@veracioux commented on GitHub (Nov 19, 2025):

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

@veracioux commented on GitHub (Nov 19, 2025): Any idea what caused/what fixed it for those terminals?
Author
Owner

@NSPC911 commented on GitHub (Nov 19, 2025):

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

@NSPC911 commented on GitHub (Nov 19, 2025): 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
Author
Owner

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

guess we will close for now then

@rekram1-node commented on GitHub (Nov 19, 2025): guess we will close for now then
Author
Owner

@NSPC911 commented on GitHub (Feb 11, 2026):

@branskugel I saw your message in https://github.com/anomalyco/opencode/issues/631#issuecomment-3883452429 , is this something related maybe?

@NSPC911 commented on GitHub (Feb 11, 2026): @branskugel I saw your message in https://github.com/anomalyco/opencode/issues/631#issuecomment-3883452429 , is this something related maybe?
Author
Owner

@Branskugel commented on GitHub (Feb 11, 2026):

@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.

@Branskugel commented on GitHub (Feb 11, 2026): > [@Branskugel](https://github.com/Branskugel) I saw your message in [#631 (comment)](https://github.com/anomalyco/opencode/issues/631#issuecomment-3883452429) , 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.
Author
Owner

@NSPC911 commented on GitHub (Feb 11, 2026):

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

@NSPC911 commented on GitHub (Feb 11, 2026): What do you mean by Pure Powershell, do you mean Powershell 5 that comes with all Windows releases?
Author
Owner

@Branskugel commented on GitHub (Feb 11, 2026):

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

@Branskugel commented on GitHub (Feb 11, 2026): > 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
Author
Owner

@NSPC911 commented on GitHub (Feb 11, 2026):

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 :/

@NSPC911 commented on GitHub (Feb 11, 2026): 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 :/
Author
Owner

@NSPC911 commented on GitHub (Feb 11, 2026):

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)

@NSPC911 commented on GitHub (Feb 11, 2026): 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)
Author
Owner

@Hona commented on GitHub (Feb 11, 2026):

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

@Hona commented on GitHub (Feb 11, 2026): Yes - my stuff in beta/tweet should fix this. I'll close the loop when it's in a stable release
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2444