Skip to content

Instantly share code, notes, and snippets.

@d630
Last active March 28, 2017 18:55
Show Gist options
  • Save d630/359a1998daacc61a6433c330d2fb9e61 to your computer and use it in GitHub Desktop.
Save d630/359a1998daacc61a6433c330d2fb9e61 to your computer and use it in GitHub Desktop.
bash
fn () { tput setaf 1; printf '<%s>\n' "$BASH_COMMAND"; tput sgr0; }
shopt -s extdebug
trap fn DEBUG
# then type:
: && $(:)
# diagnosis:
bash: $'\E[31m<:>': command not found
@d630
Copy link
Author

d630 commented Mar 28, 2017

works with:

fn () { tput setaf 1; printf '<%s>\n' "$BASH_COMMAND"; tput sgr0; } > /dev/tty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment