Add tmux availability check for conditional interactive_bash tool registration
- Implement getTmuxPath() utility to detect tmux availability at plugin load time - Add getCachedTmuxPath() for retrieving cached tmux path - Add startBackgroundCheck() for asynchronous tmux detection - Conditionally register interactive_bash tool only when tmux is available - Silently skip registration without error messages if tmux not found - Export utilities from tools/interactive-bash/index.ts Tool now gracefully handles systems without tmux installed. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -44,7 +44,7 @@ import {
|
||||
getCurrentSessionTitle,
|
||||
} from "./features/claude-code-session-state";
|
||||
import { updateTerminalTitle } from "./features/terminal";
|
||||
import { builtinTools, createCallOmoAgent, createBackgroundTools, createLookAt } from "./tools";
|
||||
import { builtinTools, createCallOmoAgent, createBackgroundTools, createLookAt, interactive_bash, getTmuxPath } from "./tools";
|
||||
import { BackgroundManager } from "./features/background-agent";
|
||||
import { createBuiltinMcps } from "./mcp";
|
||||
import { OhMyOpenCodeConfigSchema, type OhMyOpenCodeConfig, type HookName } from "./config";
|
||||
@@ -263,6 +263,8 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
? await createGoogleAntigravityAuthPlugin(ctx)
|
||||
: null;
|
||||
|
||||
const tmuxAvailable = await getTmuxPath();
|
||||
|
||||
return {
|
||||
...(googleAuthHooks ? { auth: googleAuthHooks.auth } : {}),
|
||||
|
||||
@@ -271,6 +273,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
...backgroundTools,
|
||||
call_omo_agent: callOmoAgent,
|
||||
look_at: lookAt,
|
||||
...(tmuxAvailable ? { interactive_bash } : {}),
|
||||
},
|
||||
|
||||
"chat.message": async (input, output) => {
|
||||
|
||||
Reference in New Issue
Block a user