Skip to content
Prev Previous commit
Next Next commit
Update REGEX
  • Loading branch information
edvilme committed Sep 29, 2026
commit 63df5536321899319ba9f6b606038d9555bb3259
7 changes: 7 additions & 0 deletions python_files/pythonrc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
def _initialize():
import re
import sys
import _pyrepl.utils

Check failure on line 4 in python_files/pythonrc.py

View workflow job for this annotation

GitHub Actions / Check Python types

Import "_pyrepl.utils" could not be resolved (reportMissingImports)

if sys.platform != "win32":
import readline

# Override regex to support OSC codes
_pyrepl.utils.ANSI_ESCAPE_SEQUENCE = re.compile(
r"\x1b(?:\[[ -@]*[A-~]|\][^\x1b\x07]*(?:\x07|\x1b\\))"
)

original_ps1 = getattr(sys, "ps1", ">>> ")
# PYTHONSTARTUP executes this file's code inside the user's __main__
# namespace, so PS1.__str__'s globals are the user's globals. If the
Expand Down
Loading