fix(frontend): resolve require is not defined error in terminal handler (#1243)
Replace CommonJS require() with ES module import for child_process exec function. The require() call failed because the file uses ES module syntax. Closes #1221 Signed-off-by: Antti <antti.rasi@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import { ipcMain } from 'electron';
|
||||
import { execFileSync, spawn, execFile } from 'child_process';
|
||||
import { exec, execFileSync, spawn, execFile } from 'child_process';
|
||||
import { existsSync, promises as fsPromises } from 'fs';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
@@ -502,8 +502,6 @@ export async function openTerminalWithCommand(command: string): Promise<void> {
|
||||
|
||||
// For Windows, use exec with a properly formed command string
|
||||
// This is more reliable than spawn for complex PowerShell commands with pipes
|
||||
const { exec } = require('child_process');
|
||||
|
||||
const runWindowsCommand = (cmdString: string): Promise<void> => {
|
||||
return new Promise((resolve) => {
|
||||
console.log(`[Claude Code] Executing: ${cmdString}`);
|
||||
|
||||
Reference in New Issue
Block a user