diff --git a/src/chat/main/client.c b/src/chat/main/client.c index df70f57..d9ca115 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -50,7 +50,6 @@ int main(void) for (;;) { - printf(">>> "); //TODO: Fix formatting getline(&line, &line_length, stdin); why2_send_socket(line, listen_socket); diff --git a/src/chat/misc.c b/src/chat/misc.c index 6dc2b24..6aeff86 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -265,8 +265,18 @@ void why2_clean_threads(void) void *why2_listen_server(void *socket) { + char *read = NULL; + + printf(">>> "); //TODO: Make this smart + fflush(stdout); + for (;;) { - printf("%s\n", why2_read_socket(*((int*) socket))); + read = why2_read_socket(*((int*) socket)); //TODO: Fix other user message formatting + printf("\033[A\33[2K\r"); + printf("%s\n>>> ", read); + fflush(stdout); + + why2_deallocate(read); } } \ No newline at end of file