diff --git a/main.cc b/main.cc index 4c40d17..898842e 100644 --- a/main.cc +++ b/main.cc @@ -97,6 +97,7 @@ main(int argc, char *argv[]) } else if (mode == 1) { writeToFile(logFileName, "SERVER MODE"); setupServer(PORT_NUM); + linePos++; /* No idea why, but this needs to be here. */ } while (!exit) { @@ -107,10 +108,17 @@ main(int argc, char *argv[]) if (linesInFile(logFileName) > LOG_LENGTH) linePos++; + /* clear message box / reset cursor */ move(12, 0); - printw("> "); + printw(">\t\t\t"); + move(12,2); + getstr(userInput); writeToFile(logFileName, userInput); + + if (!strncmp(userInput, "/quit", 5)) + exit = true; + if (mode == 1) send(clientSocketDescriptor, (char *)userInput, strlen(userInput), 0); else