Files
Netcatty/domain/serialEndpoint.ts
陈大猫 43d714b73c feat(serial): support local Windows named pipe consoles (#3894)
* feat(serial): support local Windows named pipe consoles

* test(serial): synchronize pipe acceptance and cover saved-host form

* fix(serial): preserve named-pipe paths with spaces when editing hosts

* test(serial): verify Windows pipes through native Electron IPC

* test(serial): keep Electron listener callbacks in renderer context

* test(serial): cover busy pipe cancellation and bounded slow-reader writes

* test(serial): construct single-instance fixture pipe path correctly
2026-10-24 12:56:58 +08:00

10 lines
381 B
TypeScript

// Keep in sync with electron/bridges/serialNamedPipe.cjs.
export function isWindowsNamedPipePath(value: string): boolean {
return /^\\\\[.?]\\pipe\\[^\r\n\0]+$/i.test(value);
}
export function isSerialEndpointPath(value: string): boolean {
return value.startsWith('/dev/') || /^COM\d+$/i.test(value)
|| /^\\\\\.\\COM\d+$/i.test(value) || isWindowsNamedPipePath(value);
}