You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
prompt_toolkit: Ansi codes instead of color when an exception occurs during completion #1565
Ansi codes are displayed in the console instead of the colors when an exception occurs when tab completing. This happens on the prompt-toolkit branch. On the main branch, the exception works as expected.
Easy way to reproduce the error on the prompt-toolkit branch is by modifying argparse_completion.py with the following:
After running the output looks like this when attempting to tab complete completion_item:
python argparse_completion.py
?[1;91mException: ?[0mpoc!?[93mTo enable full traceback, run the following command: ?[0m?[1;36mset debug true?[0m
?[1;91mException: ?[0mpoc!?[93mTo enable full traceback, run the following command: ?[0m?[1;36mset debug true?[0m
(Cmd) example --completion_item
Activity
github-actions commentedon Jan 28, 2026
🤖 Hi @bambu, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.
github-actions commentedon Jan 28, 2026
🤖 I'm sorry @bambu, but I was unable to process your request. Please see the logs for more details.
Fix output format bug when exception occurs during completion
tleonhardt commentedon Jan 29, 2026
The latest commit on the
prompt-toolkitbranch in PR #1553 fixes this bug.@bambu Thank you very much for reporting it and providing good data on how to easily reproduce.
Could you please verify this fixes the issue on your end?
Migrate from using readline to prompt-toolkit (#1553)