workon 3.2.3 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1234,6 +1234,9 @@ var init_sanitize = __esm({
1234
1234
  // src/lib/tmux.ts
1235
1235
  import { exec as execCallback, spawn as spawn7 } from "child_process";
1236
1236
  import { promisify } from "util";
1237
+ function wrapWithShellFallback(command) {
1238
+ return `${command}; exec $SHELL`;
1239
+ }
1237
1240
  var exec, TmuxManager;
1238
1241
  var init_tmux = __esm({
1239
1242
  "src/lib/tmux.ts"() {
@@ -1277,9 +1280,9 @@ var init_tmux = __esm({
1277
1280
  await this.killSession(sessionName);
1278
1281
  }
1279
1282
  const claudeCommand = claudeArgs.length > 0 ? `claude ${claudeArgs.join(" ")}` : "claude";
1280
- const escapedClaudeCmd = escapeForSingleQuotes(claudeCommand);
1283
+ const wrappedClaudeCmd = escapeForSingleQuotes(wrapWithShellFallback(claudeCommand));
1281
1284
  await exec(
1282
- `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${escapedClaudeCmd}'`
1285
+ `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${wrappedClaudeCmd}'`
1283
1286
  );
1284
1287
  await exec(`tmux split-window -h -t '${escapedSession}' -c '${escapedPath}'`);
1285
1288
  await exec(`tmux select-pane -t '${escapedSession}:0.0'`);
@@ -1293,16 +1296,15 @@ var init_tmux = __esm({
1293
1296
  await this.killSession(sessionName);
1294
1297
  }
1295
1298
  const claudeCommand = claudeArgs.length > 0 ? `claude ${claudeArgs.join(" ")}` : "claude";
1296
- const escapedClaudeCmd = escapeForSingleQuotes(claudeCommand);
1297
- const escapedNpmCmd = escapeForSingleQuotes(npmCommand);
1299
+ const wrappedClaudeCmd = escapeForSingleQuotes(wrapWithShellFallback(claudeCommand));
1300
+ const wrappedNpmCmd = escapeForSingleQuotes(wrapWithShellFallback(npmCommand));
1298
1301
  await exec(
1299
- `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${escapedClaudeCmd}'`
1302
+ `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${wrappedClaudeCmd}'`
1300
1303
  );
1301
1304
  await exec(`tmux split-window -h -t '${escapedSession}' -c '${escapedPath}'`);
1302
1305
  await exec(
1303
- `tmux split-window -v -t '${escapedSession}:0.1' -c '${escapedPath}' '${escapedNpmCmd}'`
1306
+ `tmux split-window -v -t '${escapedSession}:0.1' -c '${escapedPath}' '${wrappedNpmCmd}'`
1304
1307
  );
1305
- await exec(`tmux set-option -t '${escapedSession}:0.2' remain-on-exit on`);
1306
1308
  await exec(`tmux resize-pane -t '${escapedSession}:0.2' -y 10`);
1307
1309
  await exec(`tmux select-pane -t '${escapedSession}:0.0'`);
1308
1310
  return sessionName;
@@ -1311,15 +1313,14 @@ var init_tmux = __esm({
1311
1313
  const sessionName = this.getSessionName(projectName);
1312
1314
  const escapedSession = escapeForSingleQuotes(sessionName);
1313
1315
  const escapedPath = escapeForSingleQuotes(projectPath);
1314
- const escapedNpmCmd = escapeForSingleQuotes(npmCommand);
1316
+ const wrappedNpmCmd = escapeForSingleQuotes(wrapWithShellFallback(npmCommand));
1315
1317
  if (await this.sessionExists(sessionName)) {
1316
1318
  await this.killSession(sessionName);
1317
1319
  }
1318
1320
  await exec(`tmux new-session -d -s '${escapedSession}' -c '${escapedPath}'`);
1319
1321
  await exec(
1320
- `tmux split-window -h -t '${escapedSession}' -c '${escapedPath}' '${escapedNpmCmd}'`
1322
+ `tmux split-window -h -t '${escapedSession}' -c '${escapedPath}' '${wrappedNpmCmd}'`
1321
1323
  );
1322
- await exec(`tmux set-option -t '${escapedSession}:0.1' remain-on-exit on`);
1323
1324
  await exec(`tmux select-pane -t '${escapedSession}:0.0'`);
1324
1325
  return sessionName;
1325
1326
  }
@@ -1348,11 +1349,11 @@ var init_tmux = __esm({
1348
1349
  const escapedSession = escapeForSingleQuotes(sessionName);
1349
1350
  const escapedPath = escapeForSingleQuotes(projectPath);
1350
1351
  const claudeCommand = claudeArgs.length > 0 ? `claude ${claudeArgs.join(" ")}` : "claude";
1351
- const escapedClaudeCmd = escapeForSingleQuotes(claudeCommand);
1352
+ const wrappedClaudeCmd = escapeForSingleQuotes(wrapWithShellFallback(claudeCommand));
1352
1353
  return [
1353
1354
  `# Create tmux split session for ${sanitizeForShell(projectName)}`,
1354
1355
  `tmux has-session -t '${escapedSession}' 2>/dev/null && tmux kill-session -t '${escapedSession}'`,
1355
- `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${escapedClaudeCmd}'`,
1356
+ `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${wrappedClaudeCmd}'`,
1356
1357
  `tmux split-window -h -t '${escapedSession}' -c '${escapedPath}'`,
1357
1358
  `tmux select-pane -t '${escapedSession}:0.0'`,
1358
1359
  this.getAttachCommand(sessionName)
@@ -1363,15 +1364,14 @@ var init_tmux = __esm({
1363
1364
  const escapedSession = escapeForSingleQuotes(sessionName);
1364
1365
  const escapedPath = escapeForSingleQuotes(projectPath);
1365
1366
  const claudeCommand = claudeArgs.length > 0 ? `claude ${claudeArgs.join(" ")}` : "claude";
1366
- const escapedClaudeCmd = escapeForSingleQuotes(claudeCommand);
1367
- const escapedNpmCmd = escapeForSingleQuotes(npmCommand);
1367
+ const wrappedClaudeCmd = escapeForSingleQuotes(wrapWithShellFallback(claudeCommand));
1368
+ const wrappedNpmCmd = escapeForSingleQuotes(wrapWithShellFallback(npmCommand));
1368
1369
  return [
1369
1370
  `# Create tmux three-pane session for ${sanitizeForShell(projectName)}`,
1370
1371
  `tmux has-session -t '${escapedSession}' 2>/dev/null && tmux kill-session -t '${escapedSession}'`,
1371
- `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${escapedClaudeCmd}'`,
1372
+ `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}' '${wrappedClaudeCmd}'`,
1372
1373
  `tmux split-window -h -t '${escapedSession}' -c '${escapedPath}'`,
1373
- `tmux split-window -v -t '${escapedSession}:0.1' -c '${escapedPath}' '${escapedNpmCmd}'`,
1374
- `tmux set-option -t '${escapedSession}:0.2' remain-on-exit on`,
1374
+ `tmux split-window -v -t '${escapedSession}:0.1' -c '${escapedPath}' '${wrappedNpmCmd}'`,
1375
1375
  `tmux resize-pane -t '${escapedSession}:0.2' -y 10`,
1376
1376
  `tmux select-pane -t '${escapedSession}:0.0'`,
1377
1377
  this.getAttachCommand(sessionName)
@@ -1381,13 +1381,12 @@ var init_tmux = __esm({
1381
1381
  const sessionName = this.getSessionName(projectName);
1382
1382
  const escapedSession = escapeForSingleQuotes(sessionName);
1383
1383
  const escapedPath = escapeForSingleQuotes(projectPath);
1384
- const escapedNpmCmd = escapeForSingleQuotes(npmCommand);
1384
+ const wrappedNpmCmd = escapeForSingleQuotes(wrapWithShellFallback(npmCommand));
1385
1385
  return [
1386
1386
  `# Create tmux two-pane session with npm for ${sanitizeForShell(projectName)}`,
1387
1387
  `tmux has-session -t '${escapedSession}' 2>/dev/null && tmux kill-session -t '${escapedSession}'`,
1388
1388
  `tmux new-session -d -s '${escapedSession}' -c '${escapedPath}'`,
1389
- `tmux split-window -h -t '${escapedSession}' -c '${escapedPath}' '${escapedNpmCmd}'`,
1390
- `tmux set-option -t '${escapedSession}:0.1' remain-on-exit on`,
1389
+ `tmux split-window -h -t '${escapedSession}' -c '${escapedPath}' '${wrappedNpmCmd}'`,
1391
1390
  `tmux select-pane -t '${escapedSession}:0.0'`,
1392
1391
  this.getAttachCommand(sessionName)
1393
1392
  ];