(sess *Session, user *users.UserRecord)
| 377 | } |
| 378 | |
| 379 | func (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 | |
| 402 | func (m *CLIBridgeModule) onWindowChange(connId connections.ConnectionId, cols, rows uint32) { |
| 403 | sess := m.getSession(connId) |
no test coverage detected