Skip to content

Commit caa50dc

Browse files
authored
Fix shell integration decoration for windows pwsh (#22560)
Attempting to fix shell integration decoration glitch for windows pwsh when using Python REPL from VS Code. Resolves: #22546 #22535
1 parent 3efb54f commit caa50dc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pythonFiles/pythonrc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __str__(self):
4646
# command_start="\x1b]633;B\x07",
4747
# command_executed="\x1b]633;C\x07",
4848
# )
49-
result = f"{chr(27)}]633;D;{exit_code}0{chr(7)}{chr(27)}]633;A{chr(7)}{original_ps1}{chr(27)}]633;B{chr(7)}{chr(27)}]633;C{chr(7)}"
49+
result = f"{chr(27)}]633;D;{exit_code}{chr(7)}{chr(27)}]633;A{chr(7)}{original_ps1}{chr(27)}]633;B{chr(7)}{chr(27)}]633;C{chr(7)}"
5050

5151
return result
5252

pythonFiles/tests/test_shell_integration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_decoration_success():
1010

1111
ps1.hooks.failure_flag = False
1212
result = str(ps1)
13-
assert result == "\x1b]633;D;00\x07\x1b]633;A\x07>>> \x1b]633;B\x07\x1b]633;C\x07"
13+
assert result == "\x1b]633;D;0\x07\x1b]633;A\x07>>> \x1b]633;B\x07\x1b]633;C\x07"
1414

1515

1616
def test_decoration_failure():
@@ -20,7 +20,7 @@ def test_decoration_failure():
2020
ps1.hooks.failure_flag = True
2121
result = str(ps1)
2222

23-
assert result == "\x1b]633;D;10\x07\x1b]633;A\x07>>> \x1b]633;B\x07\x1b]633;C\x07"
23+
assert result == "\x1b]633;D;1\x07\x1b]633;A\x07>>> \x1b]633;B\x07\x1b]633;C\x07"
2424

2525

2626
def test_displayhook_call():

0 commit comments

Comments
 (0)