From 932c95b423a2d892eedbbfea1ea2815930bd3a49 Mon Sep 17 00:00:00 2001 From: Utkarsh khambra Date: Thu, 29 Dec 2022 12:04:02 +0530 Subject: [PATCH] When EOF is received, quit monomux interactive mode. --- src/client/Main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client/Main.cpp b/src/client/Main.cpp index 010e284..ed858c6 100644 --- a/src/client/Main.cpp +++ b/src/client/Main.cpp @@ -397,6 +397,11 @@ SessionSelectionResult selectSession(const std::string& ClientID, std::cout << "\nChoose 1-" << QuitChoice << ": "; std::cin >> UserChoice; + if (std::cin.eof()) + { + UserChoice = QuitChoice; + break; + } std::cin.clear(); std::cin.ignore(std::numeric_limits::max(), '\n'); if (UserChoice == 0 || UserChoice > QuitChoice)