@@ -39,13 +39,6 @@ if [[ "$PROMPT_COMMAND" =~ .*(' '.*\;)|(\;.*' ').* ]]; then
39
39
builtin return
40
40
fi
41
41
42
- # Disable shell integration if HISTCONTROL is set to erase duplicate entries as the exit code
43
- # reporting relies on the duplicates existing
44
- if [[ " $HISTCONTROL " =~ .* erasedups.* ]]; then
45
- builtin unset VSCODE_SHELL_INTEGRATION
46
- builtin return
47
- fi
48
-
49
42
if [ -z " $VSCODE_SHELL_INTEGRATION " ]; then
50
43
builtin return
51
44
fi
@@ -56,7 +49,7 @@ __vsc_original_PS2="$PS2"
56
49
__vsc_custom_PS1=" "
57
50
__vsc_custom_PS2=" "
58
51
__vsc_in_command_execution=" 1"
59
- __vsc_last_history_id= $( history 1 | awk ' {print $1;} ' )
52
+ __vsc_current_command= " "
60
53
61
54
__vsc_prompt_start () {
62
55
builtin printf " \033]633;A\007"
@@ -72,6 +65,13 @@ __vsc_update_cwd() {
72
65
73
66
__vsc_command_output_start () {
74
67
builtin printf " \033]633;C\007"
68
+ if [[ ! " $BASH_COMMAND " =~ ^__vsc_prompt* ]]; then
69
+ __vsc_current_command=$BASH_COMMAND
70
+ builtin printf " \033]633;E;$BASH_COMMAND \007"
71
+ else
72
+ __vsc_current_command=" "
73
+ builtin printf " \033]633;E\007"
74
+ fi
75
75
}
76
76
77
77
__vsc_continuation_start () {
@@ -83,12 +83,10 @@ __vsc_continuation_end() {
83
83
}
84
84
85
85
__vsc_command_complete () {
86
- local __vsc_history_id=$( builtin history 1 | awk ' {print $1;}' )
87
- if [[ " $__vsc_history_id " == " $__vsc_last_history_id " ]]; then
86
+ if [ " $__vsc_current_command " = " " ]; then
88
87
builtin printf " \033]633;D\007"
89
88
else
90
89
builtin printf " \033]633;D;%s\007" " $__vsc_status "
91
- __vsc_last_history_id=$__vsc_history_id
92
90
fi
93
91
__vsc_update_cwd
94
92
}
0 commit comments