feat(tui): add debug info dialog with copy to clipboard (#35004)

This commit is contained in:
Dustin Deus
2026-07-02 23:00:53 +02:00
committed by GitHub
parent 7f70868b99
commit 3dc2d99eaa
6 changed files with 127 additions and 20 deletions
+1 -20
View File
@@ -1,4 +1,3 @@
import { release } from "node:os"
import { TextAttributes, type ScrollBoxRenderable } from "@opentui/core"
import { useKeyboard, useTerminalDimensions } from "@opentui/solid"
import { createSignal, For, Show } from "solid-js"
@@ -6,6 +5,7 @@ import { getScrollAcceleration } from "../util/scroll"
import { useClipboard } from "../context/clipboard"
import { InstallationVersion } from "@opencode-ai/core/installation/version"
import { useExit } from "../context/exit"
import { describeOS, describeTerminal } from "../util/system"
export function ErrorComponent(props: { error: Error; reset: () => void; mode?: "dark" | "light" }) {
const term = useTerminalDimensions()
@@ -238,22 +238,3 @@ function buildIssueURL(message: string, stack: string) {
setBody(stack.slice(0, lo) + marker)
return url
}
function describeOS() {
const name =
process.platform === "darwin"
? "macOS"
: process.platform === "win32"
? "Windows"
: process.platform === "linux"
? "Linux"
: process.platform
return `${name} ${release()} (${process.arch})`
}
function describeTerminal() {
const program = process.env.TERM_PROGRAM || process.env.TERM || "unknown"
const version = process.env.TERM_PROGRAM_VERSION ? ` ${process.env.TERM_PROGRAM_VERSION}` : ""
const multiplexer = process.env.TMUX ? " in tmux" : process.env.STY ? " in screen" : ""
return `${program}${version}${multiplexer}`
}