Skip to content

Commit 9b26fde

Browse files
committed
disable python shell integration for wsl
1 parent 3e30f9d commit 9b26fde

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python_files/pythonrc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import platform
12
import sys
23

34
if sys.platform != "win32":
45
import readline
56

67
original_ps1 = ">>> "
78
use_shell_integration = sys.version_info < (3, 13)
9+
is_wsl = "microsoft-standard-WSL" in platform.release()
810

911

1012
class REPLHooks:
@@ -73,5 +75,5 @@ def __str__(self):
7375
return result
7476

7577

76-
if sys.platform != "win32" and use_shell_integration:
78+
if sys.platform != "win32" and (not is_wsl) and use_shell_integration:
7779
sys.ps1 = PS1()

0 commit comments

Comments
 (0)