Skip to content

Commit

Permalink
Implement colored prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Apr 27, 2024
1 parent 1417b9b commit 4c69853
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/_pyrepl/reader.py
Expand Up @@ -21,6 +21,7 @@

import re
import unicodedata
import traceback

from . import commands, input

Expand Down Expand Up @@ -420,6 +421,9 @@ def get_prompt(self, lineno, cursor_on_line):
res = self.ps3
else:
res = self.ps1

if traceback._can_colorize():
res = traceback._ANSIColors.BOLD_MAGENTA + res + traceback._ANSIColors.RESET
# Lazily call str() on self.psN, and cache the results using as key
# the object on which str() was called. This ensures that even if the
# same object is used e.g. for ps1 and ps2, str() is called only once.
Expand Down

0 comments on commit 4c69853

Please sign in to comment.