diff --git a/src/subcommands/dev.ts b/src/subcommands/dev.ts index 9a41fa8..2ec76e8 100644 --- a/src/subcommands/dev.ts +++ b/src/subcommands/dev.ts @@ -1,7 +1,7 @@ import { SimpleLogger, Validator } from "@lmstudio/lms-common"; import { Esbuild, EsPluginRunnerWatcher } from "@lmstudio/lms-es-plugin-runner"; import { pluginManifestSchema } from "@lmstudio/lms-shared-types/dist/PluginManifest"; -import { type ChildProcessWithoutNullStreams, spawn } from "child_process"; +import { type ChildProcess, spawn } from "child_process"; import { command } from "cmd-ts"; import { access, readFile } from "fs/promises"; import { dirname, join, resolve } from "path"; @@ -45,13 +45,12 @@ class PluginProcess { private readonly env: Record, private readonly logger: SimpleLogger, ) {} - private stdoutLogger = new SimpleLogger("stdout", this.logger); - private stderrLogger = new SimpleLogger("stderr", this.logger); - private currentProcess: ChildProcessWithoutNullStreams | null = null; + private currentProcess: ChildProcess | null = null; private status: PluginProcessStatus = "stopped"; private startProcess() { this.currentProcess = spawn(this.executable, this.args, { + stdio: "inherit", env: { FORCE_COLOR: "1", ...this.env, @@ -73,12 +72,6 @@ class PluginProcess { this.status = "stopped"; } }); - this.currentProcess.stdout.on("data", data => { - this.stdoutLogger.info(data.toString("utf-8").trimEnd()); - }); - this.currentProcess.stderr.on("data", data => { - this.stderrLogger.error(data.toString("utf-8").trimEnd()); - }); this.status = "running"; } public run() {