MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / ensureProcessStarted

Function ensureProcessStarted

desktop/terminal/manager.ts:96–109  ·  view source on GitHub ↗
(record: TerminalSessionRecord, reason: 'started' | 'restarted')

Source from the content-addressed store, hash-verified

94}
95
96function ensureProcessStarted(record: TerminalSessionRecord, reason: 'started' | 'restarted') {
97 if (record.process) {
98 return Promise.resolve()
99 }
100
101 if (record.restartPromise) {
102 return record.restartPromise
103 }
104
105 record.restartPromise = startProcess(record, reason).finally(() => {
106 record.restartPromise = null
107 })
108 return record.restartPromise
109}
110
111export async function openTerminal(request: TerminalOpenRequest): Promise<TerminalSessionSnapshot> {
112 const cwd = request.cwd ?? request.projectId

Callers 2

openTerminalFunction · 0.85
writeTerminalFunction · 0.85

Calls 1

startProcessFunction · 0.90

Tested by

no test coverage detected