code-squad-cli 2.1.0 → 2.1.1

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/index.js CHANGED
@@ -260,6 +260,8 @@ import { useState, useEffect, useCallback } from "react";
260
260
  import { render, Box, Text, useInput, useApp } from "ink";
261
261
  import * as path11 from "path";
262
262
  import * as os5 from "os";
263
+ import * as fs11 from "fs";
264
+ import * as tty from "tty";
263
265
  function shorten(p) {
264
266
  const home = os5.homedir();
265
267
  return p.startsWith(home) ? "~" + p.slice(home.length) : p;
@@ -361,8 +363,12 @@ function App({ initialWorktrees, root }) {
361
363
  }
362
364
  async function runTui(workspaceRoot) {
363
365
  const worktrees = await git.listWorktrees(workspaceRoot);
364
- const { waitUntilExit } = render(_jsx(App, { initialWorktrees: worktrees, root: workspaceRoot }), { stdout: process.stderr });
366
+ const fd = fs11.openSync("/dev/tty", "w");
367
+ const ttyStream = new tty.WriteStream(fd);
368
+ const { waitUntilExit } = render(_jsx(App, { initialWorktrees: worktrees, root: workspaceRoot }), { stdout: ttyStream });
365
369
  await waitUntilExit();
370
+ ttyStream.destroy();
371
+ fs11.closeSync(fd);
366
372
  }
367
373
  var git;
368
374
  var init_App = __esm({
@@ -1729,8 +1735,8 @@ function formatTime() {
1729
1735
  }
1730
1736
  function getSessionId() {
1731
1737
  try {
1732
- const tty = execSync2("tty", { encoding: "utf-8" }).trim();
1733
- return tty;
1738
+ const tty2 = execSync2("tty", { encoding: "utf-8" }).trim();
1739
+ return tty2;
1734
1740
  } catch {
1735
1741
  return `session-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
1736
1742
  }
@@ -2030,7 +2036,7 @@ csq() {
2030
2036
  fi
2031
2037
 
2032
2038
  local output
2033
- output=$(command csq "$@")
2039
+ output=$(command csq "$@" 2>&1)
2034
2040
  local exit_code=$?
2035
2041
 
2036
2042
  if [[ $exit_code -ne 0 ]]; then
package/dist/tui/App.js CHANGED
@@ -3,6 +3,8 @@ import { useState, useEffect, useCallback } from 'react';
3
3
  import { render, Box, Text, useInput, useApp } from 'ink';
4
4
  import * as path from 'path';
5
5
  import * as os from 'os';
6
+ import * as fs from 'fs';
7
+ import * as tty from 'tty';
6
8
  import { GitAdapter } from '../adapters/GitAdapter.js';
7
9
  import { loadConfig, getWorktreeCopyPatterns } from '../config.js';
8
10
  import { copyFilesWithPatterns } from '../fileUtils.js';
@@ -119,6 +121,12 @@ function App({ initialWorktrees, root }) {
119
121
  }
120
122
  export async function runTui(workspaceRoot) {
121
123
  const worktrees = await git.listWorktrees(workspaceRoot);
122
- const { waitUntilExit } = render(_jsx(App, { initialWorktrees: worktrees, root: workspaceRoot }), { stdout: process.stderr });
124
+ // Render to /dev/tty directly bypasses stdout/stderr capture
125
+ // so shell function's `2>&1` doesn't swallow TUI output
126
+ const fd = fs.openSync('/dev/tty', 'w');
127
+ const ttyStream = new tty.WriteStream(fd);
128
+ const { waitUntilExit } = render(_jsx(App, { initialWorktrees: worktrees, root: workspaceRoot }), { stdout: ttyStream });
123
129
  await waitUntilExit();
130
+ ttyStream.destroy();
131
+ fs.closeSync(fd);
124
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-squad-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "csq": "./dist/index.js"