@vinh0809it/claude-sessions 0.3.1 → 0.3.2

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +7 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -89,7 +89,7 @@ Sessions are grouped by profile in the UI. Press `m` to move a session to a diff
89
89
  |----------|---------|-------|
90
90
  | **Kitty** | ✅ new tab | Requires `allow_remote_control yes` in `kitty.conf` |
91
91
  | **WezTerm** | ✅ new tab | Uses `wezterm cli spawn` |
92
- | **tmux** | ✅ new window | In the current session |
92
+ | **tmux** | ✅ new window | In the current session, also when tmux runs inside kitty or WezTerm |
93
93
  | **iTerm2** | ✅ new tab | Via `osascript` |
94
94
  | **Terminal.app** | ✅ new window | Via `osascript` |
95
95
  | **Windows Terminal** | ✅ new tab | Via `wt new-tab` (native Windows; in WSL it resumes in place) |
package/index.js CHANGED
@@ -457,9 +457,11 @@ function tabComplete(input) {
457
457
 
458
458
  function detectTerminal(env = process.env, platform = process.platform) {
459
459
  if (env.CLAUDE_SESSIONS_TERMINAL) return env.CLAUDE_SESSIONS_TERMINAL;
460
+ // tmux first: it is always the innermost layer, and a tmux started from kitty or
461
+ // WezTerm inherits their variables even though their tab commands can't reach it.
462
+ if (env.TMUX) return 'tmux';
460
463
  if (env.KITTY_WINDOW_ID !== undefined) return 'kitty';
461
464
  if (env.WEZTERM_PANE !== undefined) return 'wezterm';
462
- if (env.TMUX) return 'tmux';
463
465
  if (env.TERM_PROGRAM === 'iTerm.app') return 'iterm2';
464
466
  if (env.TERM_PROGRAM === 'Apple_Terminal') return 'apple-terminal';
465
467
  // WSL also sees WT_SESSION, but there `wt` would open a Windows shell, not Linux.
@@ -471,8 +473,10 @@ function shellEsc(s) { return "'" + String(s).replace(/'/g, "'\\''") + "'"; }
471
473
  function appleStr(s) { return '"' + String(s).replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"'; }
472
474
 
473
475
  function trySpawn(cmd, args) {
474
- const r = spawnSync(cmd, args, { stdio: ['ignore', 'ignore', 'pipe'] });
475
- if (r.error) return { ok: false, msg: `${cmd}: ${r.error.code === 'ENOENT' ? 'not found' : r.error.message}` };
476
+ // Tab commands return at once; the timeout keeps a stuck one (e.g. `kitty @`
477
+ // waiting for a reply that never comes) from freezing the UI.
478
+ const r = spawnSync(cmd, args, { stdio: ['ignore', 'ignore', 'pipe'], timeout: 5000 });
479
+ if (r.error) return { ok: false, msg: `${cmd}: ${r.error.code === 'ENOENT' ? 'not found' : r.error.code === 'ETIMEDOUT' ? 'timed out' : r.error.message}` };
476
480
  return r.status === 0
477
481
  ? { ok: true }
478
482
  : { ok: false, msg: r.stderr?.toString().trim() || `${cmd} exited with ${r.status}` };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinh0809it/claude-sessions",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Fast terminal UI for browsing, previewing, resuming, renaming, moving, and deleting Claude Code sessions",
5
5
  "bin": {
6
6
  "claude-sessions": "index.js"