opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: prevent console output from corrupting TUI

Open Brandtweary opened this issue 2 weeks ago • 0 comments

Summary

  • Remove console.log calls in clipboard detection that fire on first clipboard use
  • Replace console.error with Log.Default.error in worker.ts and index.ts error handlers
  • Change stderr: "inherit" to stderr: "ignore" in spawn.ts to prevent child process errors from corrupting parent TUI

Problem

Any raw console output during TUI operation corrupts the display because the TUI expects exclusive control of terminal output. The clipboard detection was logging on first use (affecting all Linux/macOS users), and error handlers were using console.error instead of the log system.

Testing

Added regression tests for each fix that verify no console output occurs in these code paths.

Brandtweary avatar Dec 14 '25 23:12 Brandtweary