Skip to content

Bug: sqlite3 signal handling needs hardening #17114

@tobwen

Description

@tobwen

Description

When opencode db launched the interactive sqlite3 shell and I aborted it with Ctrl-C, the terminal session was left in a broken state instead of returning cleanly to the shell.

After leaving sqlite3, the prompt came back, but the next command line was corrupted: characters were echoed one by one on separate lines instead of behaving like a normal shell. The visible symptom was broken terminal/input state after Ctrl-C; the underlying issue was that opencode db did not reliably preserve the interactive sqlite3 process' signal and exit behavior, especially around SIGINT and related terminal signals. In practice this also showed up as inconsistent exits, hangs, or wrong signal-derived exit handling.

Plugins

none

OpenCode version

v1.2.24, dev

Steps to reproduce

  1. Run opencode db in a terminal where sqlite3 is available.
  2. Wait until the interactive sqlite3 prompt appears.
  3. Press Ctrl-C to leave the session.
  4. Try to run another normal shell command such as echo I am fine..
  5. Observe that the terminal/input handling is corrupted instead of returning cleanly to the shell, for example by echoing later input character-by-character on separate lines.

Screenshot and/or share link

Image

Operating System

Debian 13 (Trixie), 64-bit

Terminal

PuTTY, Mintty, MobaXterm

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions