fix(launch): scope batch validation to PTYs

This commit is contained in:
can1357
2026-07-14 23:11:07 +02:00
parent 330744bfeb
commit b76f7aeecf
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -431,7 +431,7 @@ class DaemonBroker {
if (spec.detached && spec.pty) {
throw new Error("A detached daemon cannot allocate a PTY");
}
if (process.platform === "win32" && [".bat", ".cmd"].includes(path.extname(spec.application).toLowerCase())) {
if (spec.pty && process.platform === "win32" && [".bat", ".cmd"].includes(path.extname(spec.application).toLowerCase())) {
throw new Error('Windows batch files require application "cmd.exe" with the batch path after "/c"');
}
const existing = this.#records.get(spec.name);
+4 -1
View File
@@ -86,7 +86,10 @@ export declare class PtySession {
constructor()
/** Start a shell command and stream output chunks via callback. */
start(options: PtyStartOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<PtyRunResult>
/** Start an executable with separate arguments and stream output chunks via callback. */
/**
* Start an executable with separate arguments and stream output chunks via
* callback.
*/
startArgv(options: PtyArgvStartOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<PtyRunResult>
/** Write raw input bytes to PTY stdin. */
write(data: string): void