Skip to content

Commit 34d6238

Browse files
committed
gh-127060: Disable traceback colors in IDLE
Set TERM environment variable to "dumb" to disable traceback colors in IDLE, since IDLE doesn't understand ANSI escape sequences.
1 parent 52d552c commit 34d6238

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/idlelib/pyshell.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,9 @@ def main():
15961596
enable_edit = enable_edit or edit_start
15971597
enable_shell = enable_shell or not enable_edit
15981598

1599+
# gh-127060: Disable traceback colors
1600+
os.environ['TERM'] = 'dumb'
1601+
15991602
# Setup root. Don't break user code run in IDLE process.
16001603
# Don't change environment when testing.
16011604
if use_subprocess and not testing:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Set TERM environment variable to "dumb" to disable traceback colors in IDLE,
2+
since IDLE doesn't understand ANSI escape sequences. Patch by Victor Stinner.

0 commit comments

Comments
 (0)