mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-04-06 17:10:29 +08:00
Merge branch 'master' of github.com:MCSManager/MCSManager
This commit is contained in:
commit
f9e6702557
@ -47,22 +47,23 @@ export class GoPtyProcessAdapter extends EventEmitter implements IInstanceProces
|
||||
this.initNamedPipe();
|
||||
}
|
||||
|
||||
private initNamedPipe() {
|
||||
if (!fs.existsSync(this.pipeName)) {
|
||||
private async initNamedPipe() {
|
||||
try {
|
||||
const fd = await fs.open(this.pipeName, "w");
|
||||
const writePipe = fs.createWriteStream("", { fd });
|
||||
writePipe.on("close", () => {});
|
||||
writePipe.on("end", () => {});
|
||||
writePipe.on("error", (err) => {
|
||||
logger.error("Pipe error:", this.pipeName, err);
|
||||
});
|
||||
this.pipeClient = writePipe;
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
$t("TXT_CODE_9d1d244f", {
|
||||
pipeName: this.pipeName
|
||||
pipeName: error
|
||||
})
|
||||
);
|
||||
}
|
||||
const fd = fs.openSync(this.pipeName, "w");
|
||||
const writePipe = fs.createWriteStream("", { fd });
|
||||
writePipe.on("close", () => {});
|
||||
writePipe.on("end", () => {});
|
||||
writePipe.on("error", (err) => {
|
||||
logger.error("Pipe error:", this.pipeName, err);
|
||||
});
|
||||
this.pipeClient = writePipe;
|
||||
}
|
||||
|
||||
public resize(w: number, h: number) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user