fix: Q returns to lobby instead of killing SSH session

Pressing Q in game now cleans up the session and returns to lobby,
instead of calling tea.Quit which terminates the SSH connection and
shows "Connection lost" on web. Only Ctrl+C force-quits now.

Also cleans up room on exit so abandoned rooms don't persist in lobby.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 23:18:36 +09:00
parent 24d9982b15
commit 206ac522c5
3 changed files with 30 additions and 4 deletions

View File

@@ -94,6 +94,10 @@ func isQuit(key tea.KeyMsg) bool {
return isKey(key, "q", "ctrl+c") || key.Type == tea.KeyCtrlC
}
func isForceQuit(key tea.KeyMsg) bool {
return isKey(key, "ctrl+c") || key.Type == tea.KeyCtrlC
}
func isUp(key tea.KeyMsg) bool {
return isKey(key, "up") || key.Type == tea.KeyUp
}