MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / waitForExit

Method waitForExit

modules/clibridge/clibridge.go:379–400  ·  view source on GitHub ↗
(sess *Session, user *users.UserRecord)

Source from the content-addressed store, hash-verified

377}
378
379func (m *CLIBridgeModule) waitForExit(sess *Session, user *users.UserRecord) {
380 sess.Cmd.Wait()
381 close(sess.Done)
382
383 sess.mu.Lock()
384 sess.PtyFile.Close()
385 sess.PtyFile = nil
386 sess.mu.Unlock()
387
388 m.removeSession(sess.ConnectionId)
389
390 connDetails := connections.Get(sess.ConnectionId)
391 if connDetails != nil {
392 connDetails.OutputSuppressed(false)
393 connDetails.RemoveInputHandler("CLIBridge")
394 }
395
396 if user != nil {
397 user.SendText("\n[CLI tool exited. Returning to game.]")
398 events.AddToQueue(events.RedrawPrompt{UserId: sess.UserId})
399 }
400}
401
402func (m *CLIBridgeModule) onWindowChange(connId connections.ConnectionId, cols, rows uint32) {
403 sess := m.getSession(connId)

Callers 1

onCLIRequestMethod · 0.95

Calls 10

removeSessionMethod · 0.95
GetFunction · 0.92
AddToQueueFunction · 0.92
LockMethod · 0.80
UnlockMethod · 0.80
OutputSuppressedMethod · 0.80
RemoveInputHandlerMethod · 0.80
CloseMethod · 0.65
closeFunction · 0.50
SendTextMethod · 0.45

Tested by

no test coverage detected