fix(main): PTY_EXIT 补偿查询、SSH 飞行连接登记与双窗口守卫
- 新增 SESSION_STATE 查询通道(契约先行):PTY_EXIT 只广播一次不重放, 绑定晚于退出的窗格订阅后补查一次退出状态,快速退出的 shell 不再留下 永远空白、无死亡遮罩的窗格(退出码登记表上限 512 条 FIFO) - openSession 在 connectSsh 返回前登记 pendingOpens(owner + onClient 最早引用),killPtysByOwner/killAllPtys 可中止飞行中的握手,renderer 崩溃后不再留下无主孤儿 SSH 会话 - whenReady 的 createWindow 加已有窗口守卫,堵住与 second-instance showOrCreate 的双窗口竞态 - killAllPtys 补 replayBuffers.clear(),与 killSession 拆卸清单对齐 - promptUser 注释 30s 改为实际 120s;pty.ts 顺带注入 zmodem 背压钩子 (见下一提交)
This commit is contained in:
1 parent
0289dcbd1d
commit
81ac112dac
9 files changed
+223
-24
No files matched your search
+4
-1
@@ -34,7 +34,7 @@ import {
|
||||
import { broadcast } from './broadcast'
|
||||
import { CommandsStore, defaultCommandsPath } from './commands'
|
||||
import type { CommandItem } from '../shared/commands'
|
||||
import { createPty, killPty, resizePty, writePty, openSession, configureSessionRuntime, getSessionReplay, registerLogHooks } from './pty'
|
||||
import { createPty, killPty, resizePty, writePty, openSession, configureSessionRuntime, getSessionReplay, sessionState, registerLogHooks } from './pty'
|
||||
import { respondZmodem } from './zmodem'
|
||||
import type { ZmodemResponse } from '../shared/ipc'
|
||||
|
||||
@@ -153,6 +153,9 @@ export function registerIpc(): void {
|
||||
ipcMain.handle(Ipc.PTY_CREATE, (event, opts?: PtyCreateOptions) => createPty(opts, event.sender.id))
|
||||
ipcMain.handle(Ipc.SESSION_OPEN, (event, opts: SessionOpenOptions) => openSession(opts, event.sender.id))
|
||||
ipcMain.handle(Ipc.SESSION_REPLAY, (_event, id: string) => getSessionReplay(id))
|
||||
// Compensates the one-shot PTY_EXIT broadcast: a pane that subscribed after
|
||||
// its shell died asks here instead of waiting forever.
|
||||
ipcMain.handle(Ipc.SESSION_STATE, (_event, id: string) => sessionState(id))
|
||||
ipcMain.on(Ipc.PTY_WRITE, (_event, id: string, data: string) => writePty(id, data))
|
||||
ipcMain.on(Ipc.PTY_RESIZE, (_event, id: string, cols: number, rows: number) =>
|
||||
resizePty(id, cols, rows)
|
||||
|
||||
Reference in new issue
Block a user