MCPcopy Create free account
hub / github.com/chengwaye/ghostterm / attachToSession

Function attachToSession

server.js:176–189  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

174
175 // Attach to a session
176 function attachToSession(id) {
177 const session = sessions.get(id);
178 if (!session || session.exited) return false;
179
180 // Detach from current
181 if (currentSession) {
182 currentSession.sockets.delete(socket);
183 }
184
185 currentSession = session;
186 session.sockets.add(socket);
187 socket.emit('attached', id);
188 return true;
189 }
190
191 // Don't auto-attach — let client decide via 'attach' event
192 // Client picks its last session (or first) after receiving 'sessions' list

Callers 1

server.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected