refactor(docker): update docker exec command to set working directory for terminal sessions

This commit is contained in:
Mauricio Siu
2025-08-03 01:47:31 -06:00
parent e2d6b5eb8a
commit 32f61b5e9b

View File

@@ -55,7 +55,7 @@ export const setupDockerContainerTerminalWebSocketServer = (
conn
.once("ready", () => {
conn.exec(
`docker exec -it ${containerId} ${activeWay}`,
`docker exec -it -w / ${containerId} ${activeWay}`,
{ pty: true },
(err, stream) => {
if (err) throw err;
@@ -107,7 +107,7 @@ export const setupDockerContainerTerminalWebSocketServer = (
const shell = getShell();
const ptyProcess = spawn(
shell,
["-c", `docker exec -it ${containerId} ${activeWay}`],
["-c", `docker exec -it -w / ${containerId} ${activeWay}`],
{},
);