From 59f421cd044ba2bd3b474eaf4f446577a6379eff Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 12 Mar 2024 15:52:18 +0530 Subject: [PATCH] fix: traceback colours (#25356) default ipython colours use yellow on white font, which looks horrible and is practically unreadable on most colourschemes. --- frappe/commands/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 9099012a5f..f18426887a 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -619,6 +619,14 @@ def console(context, autoreload=False): if failed_to_import: print("\nFailed to import:\n{}".format(", ".join(failed_to_import))) + # ref: https://stackoverflow.com/a/74681224 + try: + from IPython.core import ultratb + + ultratb.VerboseTB._tb_highlight = "bg:ansibrightblack" + except Exception: + pass + terminal.colors = "neutral" terminal.display_banner = False terminal()