mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
use ansi in prompt for consistency
This commit is contained in:
parent
34163e15e1
commit
77337994ca
1 changed files with 4 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ from prompt_toolkit.shortcuts import PromptSession
|
||||||
from prompt_toolkit.shortcuts import CompleteStyle
|
from prompt_toolkit.shortcuts import CompleteStyle
|
||||||
from prompt_toolkit.completion import NestedCompleter
|
from prompt_toolkit.completion import NestedCompleter
|
||||||
from prompt_toolkit.history import FileHistory
|
from prompt_toolkit.history import FileHistory
|
||||||
from prompt_toolkit.formatted_text import HTML
|
from prompt_toolkit.formatted_text import ANSI
|
||||||
|
|
||||||
from meshcore import TCPConnection, BLEConnection, SerialConnection
|
from meshcore import TCPConnection, BLEConnection, SerialConnection
|
||||||
from meshcore import MeshCore, EventType, logger
|
from meshcore import MeshCore, EventType, logger
|
||||||
|
|
@ -201,9 +201,9 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
|
||||||
while True:
|
while True:
|
||||||
prompt = ""
|
prompt = ""
|
||||||
if not last_ack:
|
if not last_ack:
|
||||||
prompt = prompt + f"<ansired>!</ansired>"
|
prompt = prompt + f"{ANSI_RED}!"
|
||||||
prompt = prompt + f"<ansiblue>{contact['adv_name']}></ansiblue> "
|
prompt = prompt + f"{ANSI_BLUE}{contact['adv_name']}>{ANSI_END} "
|
||||||
line = await session.prompt_async(HTML(prompt), complete_while_typing=False)
|
line = await session.prompt_async(ANSI(prompt), complete_while_typing=False)
|
||||||
|
|
||||||
if line == "" : # blank line
|
if line == "" : # blank line
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue