fix desktop plugin startup without Bun

This commit is contained in:
YeonGyu-Kim
2026-05-07 13:40:06 +09:00
parent 4bcbbdd966
commit 788fbec0d7
2 changed files with 51 additions and 1 deletions
+11 -1
View File
@@ -1,6 +1,16 @@
import type { OhMyOpenCodeConfig, TmuxConfig } from "./config"
import { TmuxConfigSchema } from "./config/schema/tmux"
type RuntimeWithBun = typeof globalThis & {
Bun?: {
which(binary: string): string | null
}
}
function defaultWhich(binary: string): string | null {
return (globalThis as RuntimeWithBun).Bun?.which(binary) ?? null
}
export function isTmuxIntegrationEnabled(
pluginConfig: { tmux?: { enabled?: boolean } | undefined },
): boolean {
@@ -8,7 +18,7 @@ export function isTmuxIntegrationEnabled(
}
export function isInteractiveBashEnabled(
which: (binary: string) => string | null = Bun.which,
which: (binary: string) => string | null = defaultWhich,
): boolean {
return which("tmux") !== null
}