refactor: remove terminal title update feature

OpenCode now supports terminal title updates natively (since v1.0.150,
commit 8346550), making this plugin feature redundant. Remove the
entire terminal title feature and clean up associated dead code.

Ref: https://github.com/sst/opencode/commit/8346550

Removed:
- src/features/terminal/ (title.ts, index.ts)
- src/features/claude-code-session-state/detector.ts (dead code)
- src/features/claude-code-session-state/types.ts (dead code)
- Session title tracking (setCurrentSession, getCurrentSessionTitle)
- Terminal title update calls from event handlers

Retained:
- subagentSessions (used by background-agent, session-notification)
- mainSessionID tracking (used by session recovery)

🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-17 16:12:08 +09:00
parent 0261652fa3
commit 8cdbd1cbc0
7 changed files with 0 additions and 186 deletions

View File

@@ -1,21 +0,0 @@
export function detectInterrupt(error: unknown): boolean {
if (!error) return false
if (typeof error === "object") {
const errObj = error as Record<string, unknown>
const name = errObj.name as string | undefined
const message = errObj.message as string | undefined
if (name === "MessageAbortedError" || name === "AbortError") return true
if (name === "DOMException" && message?.includes("abort")) return true
const msgLower = message?.toLowerCase()
if (msgLower?.includes("aborted") || msgLower?.includes("cancelled") || msgLower?.includes("interrupted")) return true
}
if (typeof error === "string") {
const lower = error.toLowerCase()
return lower.includes("abort") || lower.includes("cancel") || lower.includes("interrupt")
}
return false
}

View File

@@ -1,3 +1 @@
export * from "./types"
export * from "./state"
export * from "./detector"

View File

@@ -1,31 +1,11 @@
import type { SessionErrorState, SessionInterruptState } from "./types"
export const sessionErrorState = new Map<string, SessionErrorState>()
export const sessionInterruptState = new Map<string, SessionInterruptState>()
export const subagentSessions = new Set<string>()
export const sessionFirstMessageProcessed = new Set<string>()
export let currentSessionID: string | undefined
export let currentSessionTitle: string | undefined
export let mainSessionID: string | undefined
export function setCurrentSession(id: string | undefined, title: string | undefined) {
currentSessionID = id
currentSessionTitle = title
}
export function setMainSession(id: string | undefined) {
mainSessionID = id
}
export function getCurrentSessionID(): string | undefined {
return currentSessionID
}
export function getCurrentSessionTitle(): string | undefined {
return currentSessionTitle
}
export function getMainSessionID(): string | undefined {
return mainSessionID
}

View File

@@ -1,8 +0,0 @@
export interface SessionErrorState {
hasError: boolean
errorMessage?: string
}
export interface SessionInterruptState {
interrupted: boolean
}