Update CHANGELOG.md, fix logo centering, and enhance totally reset cursor functionality. Revert cursor reset to beta, add new confirmation and display functions, and improve file handling for cursor-related paths.

This commit is contained in:
yeongpin
2025-03-28 23:27:00 +08:00
parent 1b6ba5eab8
commit 28cd662e83
4 changed files with 471 additions and 155 deletions

View File

@@ -20,7 +20,7 @@ init()
# get terminal width
def get_terminal_width():
try:
columns, _ = shutil.get_terminal_size()
columns, _ = shutil.get_terminal_size()/2
return columns
except:
return 80 # default width
@@ -34,7 +34,7 @@ def center_multiline_text(text, handle_chinese=False):
for line in lines:
# calculate actual display width (remove ANSI color codes)
clean_line = line
for color in [Fore.CYAN, Fore.YELLOW, Fore.GREEN, Fore.RED, Style.RESET_ALL]:
for color in [Fore.CYAN, Fore.YELLOW, Fore.GREEN, Fore.RED, Fore.BLUE, Style.RESET_ALL]:
clean_line = clean_line.replace(color, '')
# remove all ANSI escape sequences to get the actual length