Browse Source

start file watcher only for tui

Dax Raad 7 months ago
parent
commit
6100a77b85
2 changed files with 2 additions and 2 deletions
  1. 0 2
      packages/opencode/src/cli/bootstrap.ts
  2. 2 0
      packages/opencode/src/cli/cmd/tui.ts

+ 0 - 2
packages/opencode/src/cli/bootstrap.ts

@@ -1,6 +1,5 @@
 import { App } from "../app/app"
 import { ConfigHooks } from "../config/hooks"
-import { FileWatcher } from "../file/watch"
 import { Format } from "../format"
 import { LSP } from "../lsp"
 import { Share } from "../share/share"
@@ -11,7 +10,6 @@ export async function bootstrap<T>(input: App.Input, cb: (app: App.Info) => Prom
     Format.init()
     ConfigHooks.init()
     LSP.init()
-    FileWatcher.init()
 
     return cb(app)
   })

+ 2 - 0
packages/opencode/src/cli/cmd/tui.ts

@@ -10,6 +10,7 @@ import { Installation } from "../../installation"
 import { Config } from "../../config/config"
 import { Bus } from "../../bus"
 import { Log } from "../../util/log"
+import { FileWatcher } from "../../file/watch"
 
 export const TuiCommand = cmd({
   command: "$0 [project]",
@@ -40,6 +41,7 @@ export const TuiCommand = cmd({
         return
       }
       const result = await bootstrap({ cwd }, async (app) => {
+        FileWatcher.init()
         const providers = await Provider.list()
         if (Object.keys(providers).length === 0) {
           return "needs_provider"