AeroSpace CLI Commands Hang When Executed via Node.js child_process #972
-
| Summary: Environment: 
 Reproduction: 
 Expected behavior: Commands should return JSON data promptly, as they do in the terminal. Actual behavior: Commands hang indefinitely without returning or throwing an error. Technical Details: Here's the relevant implementation that demonstrates the issue: const execAsync = promisify(exec);
// This hangs indefinitely
const workspacesStdout = await execAsync('aerospace list-workspaces --all');Additional Notes: 
 Would appreciate any insights into whether this might be related to how AeroSpace handles stdout/stderr when called programmatically vs. interactively. | 
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
| I can confirm the same behavior on my side (different environment): Environment
 Findings
 Sharing this info in case it helps narrow down the cause. | 
Beta Was this translation helpful? Give feedback.
-
| I had some time, so I investigated the cause of this behavior. Therefore, closing stdin on the Node.js side resolves the problem: const { exec } = require("node:child_process");
const child = exec("aerospace --version", (error, stdout, stderr) => {
  console.log(`stdout: ${stdout}`);
});
// close stdin
child.stdin.end(); | 
Beta Was this translation helpful? Give feedback.
-
| Tracking issue: #1683 | 
Beta Was this translation helpful? Give feedback.

Tracking issue: #1683