diff --git a/ws/ws.cpp b/ws/ws.cpp index 139539a9..18b3f336 100644 --- a/ws/ws.cpp +++ b/ws/ws.cpp @@ -21,6 +21,9 @@ #ifndef _WIN32 #include +#else +#include +#define getpid _getpid #endif diff --git a/ws/ws_chat.cpp b/ws/ws_chat.cpp index 4fb03412..641e4f81 100644 --- a/ws/ws_chat.cpp +++ b/ws/ws_chat.cpp @@ -9,13 +9,13 @@ // Broadcast server can be ran with `ws broadcast_server` // -#include "linenoise.hpp" #include "nlohmann/json.hpp" #include #include #include #include #include +#include // for convenience using json = nlohmann::json; @@ -172,9 +172,10 @@ namespace ix { // Read line std::string line; - auto quit = linenoise::Readline("> ", line); + std::cout << user << " > " << std::flush; + std::getline(std::cin, line); - if (quit) + if (!std::cin) { break; }