mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-06 21:02:04 +00:00
Pause before clearing screen
This commit is contained in:
1 parent
3cda7208ee
commit
7b9b9a082e
3 files changed
+24
-2
No files matched your search
@@ -28,7 +28,7 @@ try:
|
||||
from .input_utils import timed_input
|
||||
from .memory_protection import InMemorySecret
|
||||
from .clipboard import copy_to_clipboard
|
||||
from .terminal_utils import clear_screen
|
||||
from .terminal_utils import clear_screen, pause
|
||||
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.info("Modules imported successfully.")
|
||||
@@ -57,4 +57,5 @@ __all__ = [
|
||||
"InMemorySecret",
|
||||
"copy_to_clipboard",
|
||||
"clear_screen",
|
||||
"pause",
|
||||
]
|
||||
@@ -1,6 +1,18 @@
|
||||
"""Utility functions for terminal output."""
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def clear_screen() -> None:
|
||||
"""Clear the terminal screen using an ANSI escape code."""
|
||||
print("\033c", end="")
|
||||
|
||||
|
||||
def pause(message: str = "Press Enter to continue...") -> None:
|
||||
"""Wait for the user to press Enter before proceeding."""
|
||||
if not sys.stdin or not sys.stdin.isatty():
|
||||
return
|
||||
try:
|
||||
input(message)
|
||||
except EOFError:
|
||||
pass
|
||||
Reference in new issue
Block a user