Add logs tab with real-time server output and consolidate syntax highlighting
- Implement dedicated Logs tab showing stdout/stderr from OpenCode server - Add log level parsing (INFO, ERROR, WARN, DEBUG) with color coding - Stream logs from main process to renderer via IPC events - Persist scroll position and auto-scroll state per instance - Synchronize instance IDs between renderer and main process - Consolidate syntax highlighting to single shared highlighter instance - Optimize markdown rendering with global highlighter initialization - Fix code block copy button to always appear on right side - Enable debug logging with --print-logs --log-level DEBUG flags
This commit is contained in:
@@ -18,9 +18,9 @@ function generateId(): string {
|
||||
}
|
||||
|
||||
export function setupInstanceIPC(mainWindow: BrowserWindow) {
|
||||
ipcMain.handle("instance:create", async (event, folder: string) => {
|
||||
const id = generateId()
|
||||
processManager.setMainWindow(mainWindow)
|
||||
|
||||
ipcMain.handle("instance:create", async (event, id: string, folder: string) => {
|
||||
const instance: Instance = {
|
||||
id,
|
||||
folder,
|
||||
@@ -32,7 +32,7 @@ export function setupInstanceIPC(mainWindow: BrowserWindow) {
|
||||
instances.set(id, instance)
|
||||
|
||||
try {
|
||||
const { pid, port } = await processManager.spawn(folder)
|
||||
const { pid, port } = await processManager.spawn(folder, id)
|
||||
|
||||
instance.port = port
|
||||
instance.pid = pid
|
||||
@@ -48,7 +48,7 @@ export function setupInstanceIPC(mainWindow: BrowserWindow) {
|
||||
})
|
||||
}
|
||||
|
||||
return { port, pid }
|
||||
return { id, port, pid }
|
||||
} catch (error) {
|
||||
instance.status = "error"
|
||||
instance.error = error instanceof Error ? error.message : String(error)
|
||||
|
||||
Reference in New Issue
Block a user