Merge remote-tracking branch 'origin/main' into nanobot-webui

This commit is contained in:
Xubin Ren
2026-04-19 05:15:27 +00:00
8 changed files with 340 additions and 46 deletions
+11 -1
View File
@@ -18,7 +18,17 @@ from nanobot import __logo__
def _make_console() -> Console:
return Console(file=sys.stdout, force_terminal=True)
"""Create a Console that emits plain text when stdout is not a TTY.
Rich's spinner, Live render, and cursor-visibility escape codes all
key off ``Console.is_terminal``. Forcing ``force_terminal=True`` overrode
the ``isatty()`` check and caused control sequences (``\\x1b[?25l``,
braille spinner frames) to pollute programmatic consumers such as
``docker exec -i`` or pipes, even with ``NO_COLOR`` or ``TERM=dumb``.
Deferring to ``isatty()`` keeps Rich output in interactive terminals
and plain text everywhere else (#3265).
"""
return Console(file=sys.stdout, force_terminal=sys.stdout.isatty())
class ThinkingSpinner: