Skip to content

Commit d36baf6

Browse files
committed
minor fix
1 parent 45f3dc9 commit d36baf6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/azure-cli-core/azure/cli/core/what_if.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _make_what_if_request(payload, headers_dict, cli_ctx=None):
4848
def _rotating_progress():
4949
"""Simulate a rotating progress indicator."""
5050
spinner_chars = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
51-
fallback_chars = ["|", "\\", "/", "-"]
51+
fallback_chars = ["|", "/", "-", "\\"]
5252

5353
try:
5454
"⠋".encode(sys.stderr.encoding or 'utf-8')
@@ -92,17 +92,11 @@ def _rotating_progress():
9292
elapsed_str = f"{BOLD}({elapsed:.0f}s){RESET}"
9393
spinner = f"{spinner_color}{chars[idx % len(chars)]}{RESET}"
9494
progress_line = f"{spinner} {status}... {elapsed_str}"
95-
visible_length = len(progress_line) - (progress_line.count('\033[') * 5)
96-
max_width = 100
97-
if visible_length > max_width:
98-
truncated_status = status[:max_width - 30] + "..."
99-
progress_line = f"{spinner} {truncated_status} {elapsed_str}"
100-
sys.stderr.write(f"\r{' ' * 120}\r{progress_line}")
95+
sys.stderr.write(f"\033[2K\r{progress_line}")
10196
sys.stderr.flush()
10297
idx += 1
10398
time.sleep(0.12)
104-
clear_line = f"\r{' ' * 120}\r"
105-
sys.stderr.write(clear_line)
99+
sys.stderr.write("\033[2K\r")
106100
sys.stderr.flush()
107101

108102
try:

0 commit comments

Comments
 (0)