From f277edfd9bb9809782d80ae7f37d372046882155 Mon Sep 17 00:00:00 2001 From: Ben de Roo Date: Sat, 21 Feb 2026 14:37:14 +0100 Subject: [PATCH] Update client.py --- client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client.py b/client.py index b9cd247..18a6cbd 100644 --- a/client.py +++ b/client.py @@ -67,7 +67,7 @@ def recv_json(sock): return json.loads(buffer.decode("utf-8")) except json.JSONDecodeError: continue - return {} # fallback, lege dict als niks lukt + return {} def login(): base_dir = Path(__file__).parent @@ -140,6 +140,8 @@ chat_data = recv_json(s) chat_names = list(chat_data.keys()) def draw_chat_window(messages, chatname): + current_input = readline.get_line_buffer() # bewaar wat je typt + clear() w, h = term_size() print(blauw_bg + wit + chatname.center(w) + reset) @@ -153,6 +155,9 @@ def draw_chat_window(messages, chatname): else: print_white(f"[{user}] {text}") print("-" * w) + + readline.insert_text(current_input) # herstel input + readline.redisplay() def chat_session(chatkeuze): global chat_messages, chat_users