Skip to content

Commit 56249be

Browse files
committed
feat: colored prompt
1 parent d574f2b commit 56249be

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

clit/ui.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"""User interface."""
22
import sys
3+
import time
34
from pathlib import Path
45
from subprocess import PIPE, CalledProcessError
56

7+
import click
8+
69
from clit.files import shell
710

811

@@ -21,6 +24,9 @@ def notify(title, message):
2124
)
2225

2326

24-
def prompt(message: str) -> None:
25-
"""Display a prompt with a message."""
26-
input(f"{message}\nPress ENTER to continue or Ctrl-C to abort")
27+
def prompt(message: str, fg: str = "bright_white") -> None:
28+
"""Display a prompt with a message. Wait a little bit before, so stdout is flushed before the input message."""
29+
print()
30+
click.secho(message, fg=fg)
31+
time.sleep(0.2)
32+
input("Press ENTER to continue or Ctrl-C to abort: ")

0 commit comments

Comments
 (0)