From d5485a833f085fe5ee2e9b43e35fab6c937c1162 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 10 Oct 2021 12:17:29 +0200 Subject: [PATCH] CLIConsole: On 'exit', ask whether to quit attached instance --- cliconsole.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cliconsole.cpp b/cliconsole.cpp index 28e1d10..7fc0122 100644 --- a/cliconsole.cpp +++ b/cliconsole.cpp @@ -104,7 +104,17 @@ void CLIConsole::startInteractive() auto pair = CLIHandler::splitCommand(input); if(pair.first == "exit") { - std::cout << "Exiting CLI"; + if(attached) + { + std::cout << "You are attached. Quit attached instance too (y) or only this one(n)" << std::endl; + char response; + std::cin >> response; + if(response == 'y') + { + this->send("exit"); + } + } + std::cout << "Exiting CLI" << std::endl; exit(EXIT_SUCCESS); } if(pair.first == "attach")