From 34163e15e1678ef55e8d758e825e4202ec7d51f9 Mon Sep 17 00:00:00 2001 From: Florent de Lamotte Date: Fri, 18 Apr 2025 23:27:00 +0200 Subject: [PATCH] color promp --- src/meshcore_cli/meshcore_cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index a168be5..8ec12cc 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -12,6 +12,7 @@ from prompt_toolkit.shortcuts import PromptSession from prompt_toolkit.shortcuts import CompleteStyle from prompt_toolkit.completion import NestedCompleter from prompt_toolkit.history import FileHistory +from prompt_toolkit.formatted_text import HTML from meshcore import TCPConnection, BLEConnection, SerialConnection from meshcore import MeshCore, EventType, logger @@ -200,9 +201,9 @@ Line starting with \"$\" or \".\" will issue a meshcli command. while True: prompt = "" if not last_ack: - prompt = prompt + f"!" - prompt = prompt + f"{contact['adv_name']}> " - line = await session.prompt_async(prompt, complete_while_typing=False) + prompt = prompt + f"!" + prompt = prompt + f"{contact['adv_name']}> " + line = await session.prompt_async(HTML(prompt), complete_while_typing=False) if line == "" : # blank line pass