File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/vs/workbench/contrib/terminal/browser/media Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 33
33
# Marks the beginning of command output.
34
34
function __vsc_cmd_executed --on-event fish_preexec
35
35
__vsc_esc C
36
- __vsc_esc E " $argv "
36
+ __vsc_esc E (__vsc_escape_cmd " $argv " )
37
+ end
38
+
39
+
40
+ # Escapes backslashes, newlines, and semicolons to serialize the command line.
41
+ function __vsc_escape_cmd
42
+ set -l commandline " $argv "
43
+ # `string replace` automatically breaks its input apart on any newlines.
44
+ # Then `string join` at the end will bring it all back together.
45
+ string replace --all ' \\' ' \\\\ ' $commandline \
46
+ | string replace --all ' ;' ' \ x3b' \
47
+ | string join ' \ x0a'
37
48
end
38
49
39
50
# Sent right after an interactive command has finished executing.
You can’t perform that action at this time.
0 commit comments