TUI crashes during prompt edit
Description
I edited my prompt. I tried Command+backspace wich used to delete a line but nothing happened. Then I continued deleting words with Option+backspace and after I deleted a line the TUI crashed and I saw my shell prompt in the middle of the screen.
OpenCode version
1.0.9
Steps to reproduce
Not sure and not willing to investigate. You guys totally messed up with the recent big change. Nothing works anymore.
Screenshot and/or share link
Operating System
macOS 26.0.1
Terminal
Ghostty
It's sad seeing this app crumble. It was the best agentic editor for a while.
This issue might be a duplicate of existing issues. Please check:
- #3691: Terminal/shell crashes - similar TUI crash behavior that affects the terminal
- #3648: Screen redraw issues after editing - similar editing-related TUI display problems
- #3745: Command+Option keyboard shortcut issues on macOS - similar macOS keyboard shortcut problems
Feel free to ignore if none of these address your specific case.
To the maintainers: I did some experimentation, and while I couldn't replicate the SIGTRAP, I do get a SIGABRT, with this printed:
/usr/include/c++/13/array:202: reference std::array<unsigned long, 16>::operator[](size_type) [_Tp = unsigned long, _Nm = 16]: Assertion '__n < this->size()' failed.
(maybe more is printed which I'm not able to see because of the already-rendered TUI)
My specs: Arch Linux, Alacritty
Reproducing
- Paste a long text into the prompt textarea
- Hold
alt+backspaceor regularbackspace
It is kinda unpredictable after how much time it will crash, but I am able to reproduce quite consistently. alt+backspace seems more likely to reproduce it than plain backspace. Also might depend on the keyboard repeat rate - I have mine set to quite high.
@kommander This seems to be an opentui issue because I reproduced with a minimalistic opentui project:
https://gist.github.com/veracioux/167b3645c23ccb29620814789ea1565f
In this project, sometimes it crashes with SIGABRT and an error message as the one above, and sometimes with this one:
Bun v1.3.1 (89fa0f34) Linux x64 │
Linux Kernel v6.17.1 | glibc v2.42 │
CPU: sse42 popcnt avx avx2 avx512───────────────────────────────────────────────────────────────────────────────────┘
Args: "bun" "src/index.ts"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) bunfig fetch jsc transpiler_cache tsconfig(2) tsconfig_paths(2) virtual_modules(2)
Builtins: "bun:ffi" "bun:main" "node:assert" "node:buffer" "node:console" "node:events" "node:fs" "node:fs/promises" "node:module" "node:os" "node:path" "node:stream" "node:tty" "node:url" "node:util"
Elapsed: 716ms | User: 343ms | Sys: 89ms
RSS: 1.10GB | Peak: 0.14GB | Commit: 1.10GB | Faults: 1 | Machine: 29.21GB
panic(main thread): Segmentation fault at address 0x7F90872C29A0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Bug Report: Segmentation Fault on Bun v1.3.0
Description Bun crashes with a segmentation fault (address 0x783C21E1E220) immediately upon startup. The crash appears to occur during the initialization phase. What happened:
Bun terminated with "Segmentation fault at address 0x783C21E1E220" The process crashed before executing any user code No specific error message about what caused the crash
Bun version: v1.3.0 (b0a6faca) OS: Linux x64 (baseline) Kernel: Linux v6.12.56 glibc: v2.42 CPU: sse42 popent avx avx2 avx512
### **When** it happens:
The crash occurs immediately when running Bun, during the startup/initialization phase.
### **Error Output**
panic(main thread): Segmentation fault at address 0x783C21E1E220 oh no: Bun has crashed. This indicates a bug in Bun, not your code.
### **System Information**
- **RAM**: 1.016B
- **Peak Memory**: 0.27GB
- **Commit**: 1.016B
- **Faults**: 0
- **Machine**: 41.756B
### **How to Reproduce**
1. Install Bun v1.3.0
2. Run any Bun command (even `bun --version`)
3. Observe segmentation fault
### **Expected Behavior**
Bun should start normally without crashing.
### **Actual Behavior**
Bun crashes with a segmentation fault before executing any code.
### **Additional Context**
- The crash report shows multiple Node.js compatibility modules being loaded
- Error occurs at memory address: `0x783C21E1E220`
- Elapsed time before crash: 6298ms
- User: 1436ms | Sys: 301ms
### **Possible Related Information**
The crash log shows various Node.js built-in modules being loaded:
- `node:assert`, `node:async_hooks`, `node:buffer`, `node:child_process`, `node:console`, `node:crypto`, `node:events`, `node:fs`, `node:http`, `node:https`, `node:module`, `node:net`, `node:os`, `node:path`, `node:process`, `node:readline`, `node:stream`, `node:string_decoder`, `node:timers`, `node:timers/promises`, `node:tls`, `node:tty`, `node:url`, `node:util`, `undici`
@veracioux from opentui the only thing that is c++ would be yoga-layout. Would need to run this with lldb and a debug build of bun and opentui.