Skip to content

Commit 688790f

Browse files
chapterjasonclaude
andcommitted
Resolve tmux.conf from both dev and bundled layouts
The vite bundle collapses the src/session/ directory into a flat dist/index.js, so ../../tmux.conf no longer lands on server/tmux.conf at runtime. Try both candidate paths and use whichever exists. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dfd82a3 commit 688790f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-shell",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"private": true,
55
"type": "module",
66
"main": "server/dist/index.js",

server/src/session/session.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { existsSync } from "node:fs";
12
import { spawn, type IPty } from "node-pty";
23
import { randomUUID } from "node:crypto";
34
import { dirname, resolve } from "node:path";
@@ -8,7 +9,11 @@ import { sanitizeForReplay } from "./replay.js";
89
import { Scrollback } from "./scrollback.js";
910
import * as tmux from "./tmux.js";
1011

11-
const TMUX_CONF = resolve(dirname(fileURLToPath(import.meta.url)), "../../tmux.conf");
12+
const here = dirname(fileURLToPath(import.meta.url));
13+
// Dev (src/session/) and bundled (dist/) layouts put tmux.conf at different depths.
14+
const TMUX_CONF =
15+
[resolve(here, "../../tmux.conf"), resolve(here, "../tmux.conf")].find(existsSync) ??
16+
resolve(here, "../tmux.conf");
1217

1318
export type OutputListener = (chunk: string) => void;
1419
export type ExitListener = (code: number, signal?: number) => void;

0 commit comments

Comments
 (0)