Skip to content

Commit

Permalink
Support zsh skipped commands
Browse files Browse the repository at this point in the history
Fixes #142640
  • Loading branch information
Tyriar committed Feb 18, 2022
1 parent 91d8566 commit 5130d2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/vs/workbench/contrib/terminal/browser/media/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
autoload -Uz add-zsh-hook

IN_COMMAND_EXECUTION="1"
LAST_HISTORY_ID=0

prompt_start() {
printf "\033]633;A\007"
}
Expand All @@ -23,7 +25,13 @@ command_output_start() {
}

command_complete() {
printf "\033]633;D;%s\007" "$STATUS"
local HISTORY_ID=$(history | tail -n1 | awk '{print $1;}')
if [[ "$HISTORY_ID" == "$LAST_HISTORY_ID" ]]; then
printf "\033]633;D\007"
else
printf "\033]633;D;%s\007" "$STATUS"
LAST_HISTORY_ID=$HISTORY_ID
fi
update_cwd
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ command_complete() {
printf "\033]633;D;%s\007" "$STATUS"
LAST_HISTORY_ID=$HISTORY_ID
fi

update_cwd
}

Expand Down

0 comments on commit 5130d2e

Please sign in to comment.