Bläddra i källkod

fix: terminal in desktop

Adam 9 månader sedan
förälder
incheckning
c4f63824df
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      packages/opencode/src/pty/index.ts

+ 5 - 1
packages/opencode/src/pty/index.ts

@@ -114,8 +114,12 @@ export namespace Pty {
     const id = Identifier.create("pty", false)
     const id = Identifier.create("pty", false)
     const command = input.command || Shell.preferred()
     const command = input.command || Shell.preferred()
     const args = input.args || []
     const args = input.args || []
+    if (command.endsWith("sh")) {
+      args.push("-l")
+    }
+
     const cwd = input.cwd || Instance.directory
     const cwd = input.cwd || Instance.directory
-    const env = { ...process.env, ...input.env } as Record<string, string>
+    const env = { ...process.env, ...input.env, TERM: "xterm-256color" } as Record<string, string>
     log.info("creating session", { id, cmd: command, args, cwd })
     log.info("creating session", { id, cmd: command, args, cwd })
 
 
     const spawn = await pty()
     const spawn = await pty()