Skip to content

Commit

Permalink
Handle skipped commands in bash
Browse files Browse the repository at this point in the history
Part of #142640
  • Loading branch information
Tyriar committed Feb 14, 2022
1 parent 458dda8 commit 6e63b1e
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ else
fi

IN_COMMAND_EXECUTION="1"
LAST_HISTORY_ID=$(history | tail -n1 | awk '{print $1;}')

prompt_start() {
printf "\033]633;A\007"
}
Expand All @@ -32,7 +34,14 @@ 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

0 comments on commit 6e63b1e

Please sign in to comment.