mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
16 lines
629 B
TypeScript
16 lines
629 B
TypeScript
import { resolve, type Info, type Resolved } from "../../src/config"
|
|
import { TuiKeybind } from "../../src/config/keybind"
|
|
|
|
type ResolvedInput = Omit<Info, "attention" | "keybinds" | "leader"> & {
|
|
attention?: Partial<Resolved["attention"]>
|
|
keybinds?: Partial<TuiKeybind.Keybinds>
|
|
leader?: { timeout?: number }
|
|
}
|
|
|
|
export function createTuiResolvedConfig(input: ResolvedInput = {}, options?: { terminal?: boolean }) {
|
|
const config = resolve(input, { terminalSuspend: process.platform !== "win32" })
|
|
return {
|
|
...config,
|
|
session: { ...config.session, terminal: options?.terminal ?? config.session.terminal },
|
|
}
|
|
}
|