File tree 2 files changed +17
-10
lines changed 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,15 @@ def __str__(self):
39
39
exit_code = 0
40
40
41
41
# Guide following official VS Code doc for shell integration sequence:
42
- # result = "{command_finished}{prompt_started}{prompt}{command_start}{command_executed}".format(
43
- # command_finished="\x1b]633;D;" + str(exit_code) + "0\x07",
44
- # prompt_started="\x1b]633;A\x07",
45
- # prompt=original_ps1,
46
- # command_start="\x1b]633;B\x07",
47
- # command_executed="\x1b]633;C\x07",
48
- # )
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 )} "
42
+ result = "{command_explicit}{command_finished}{prompt_started}{prompt}{command_start}{command_executed}" .format (
43
+ command_explicit = "\x1b ]633;E;\x07 " ,
44
+ command_finished = "\x1b ]633;D;" + str (exit_code ) + "\x07 " ,
45
+ prompt_started = "\x1b ]633;A\x07 " ,
46
+ prompt = original_ps1 ,
47
+ command_start = "\x1b ]633;B\x07 " ,
48
+ command_executed = "\x1b ]633;C\x07 " ,
49
+ )
50
+ # 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)}"
50
51
51
52
return result
52
53
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ def test_decoration_success():
10
10
11
11
ps1 .hooks .failure_flag = False
12
12
result = str (ps1 )
13
- assert result == "\x1b ]633;D;0\x07 \x1b ]633;A\x07 >>> \x1b ]633;B\x07 \x1b ]633;C\x07 "
13
+ assert (
14
+ result
15
+ == "\x1b ]633;E;\x07 \x1b ]633;D;0\x07 \x1b ]633;A\x07 >>> \x1b ]633;B\x07 \x1b ]633;C\x07 "
16
+ )
14
17
15
18
16
19
def test_decoration_failure ():
@@ -20,7 +23,10 @@ def test_decoration_failure():
20
23
ps1 .hooks .failure_flag = True
21
24
result = str (ps1 )
22
25
23
- assert result == "\x1b ]633;D;1\x07 \x1b ]633;A\x07 >>> \x1b ]633;B\x07 \x1b ]633;C\x07 "
26
+ assert (
27
+ result
28
+ == "\x1b ]633;E;\x07 \x1b ]633;D;1\x07 \x1b ]633;A\x07 >>> \x1b ]633;B\x07 \x1b ]633;C\x07 "
29
+ )
24
30
25
31
26
32
def test_displayhook_call ():
You can’t perform that action at this time.
0 commit comments