Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/src/services/cliManagerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class CliManagerFactory {
additionalOptions?: JsonObject
) => {
let permissionIpcPath: string | null = null;
if (additionalOptions?.permissionIpcPath !== undefined) {
if (additionalOptions?.permissionIpcPath !== undefined && additionalOptions?.permissionIpcPath !== null) {
permissionIpcPath = decodeBoundary(additionalOptions.permissionIpcPath, boundary.string);
}

Expand Down
12 changes: 7 additions & 5 deletions main/src/services/permissionIpcServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ export class PermissionIpcServer {
socketDir = os.tmpdir();
}

this.socketPath = path.join(socketDir, `pane-permissions-${process.pid}.sock`);
this.socketPath = process.platform === 'win32'
? `\\\\.\\pipe\\pane-permissions-${process.pid}`
: path.join(socketDir, `pane-permissions-${process.pid}.sock`);
}

start(): Promise<void> {
return new Promise((resolve, reject) => {
// Clean up any existing socket file
if (fs.existsSync(this.socketPath)) {
// Clean up any existing socket file (skip on Windows: named pipes are not filesystem entries)
if (process.platform !== 'win32' && fs.existsSync(this.socketPath)) {
fs.unlinkSync(this.socketPath);
}

Expand Down Expand Up @@ -116,8 +118,8 @@ export class PermissionIpcServer {

if (this.server) {
this.server.close(() => {
// Clean up socket file
if (fs.existsSync(this.socketPath)) {
// Clean up socket file (skip on Windows: named pipes are not filesystem entries)
if (process.platform !== 'win32' && fs.existsSync(this.socketPath)) {
fs.unlinkSync(this.socketPath);
}
resolve();
Expand Down