2021-07-29 05:44:12 -07:00
|
|
|
#!/usr/bin/env sh
|
2024-03-26 15:08:14 -07:00
|
|
|
# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK
|
2021-09-23 07:15:19 -07:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
wipe() { ### @-
|
|
|
|
### clear the screen and its scrollback, then print a high-contrast horizontal line.
|
|
|
|
### using this, you'll know with absolute certainty that you're looking at the top of your history,
|
|
|
|
### and that your terminal's scrollback didn't cap out and eat text.
|
|
|
|
###
|
|
|
|
### **TODO:** rename because wipe(1) already exists.
|
2021-07-29 00:37:35 -07:00
|
|
|
[ $# -le 0 ] || { printf "%s\n" "$0: too many arguments" >&2; return 1; }
|
|
|
|
clear
|
|
|
|
clear # twice because mintty is weird
|
2021-09-23 06:48:05 -07:00
|
|
|
printf '\033[30m\033[107m\n'
|
2021-07-29 05:44:12 -07:00
|
|
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
|
|
|
printf '*%.0s' {1..$COLUMNS}
|
|
|
|
else
|
|
|
|
tput cols | awk '{for(i=0;i<$0;i++)printf "*"}'
|
|
|
|
fi
|
2021-09-23 06:48:05 -07:00
|
|
|
printf '\033[0m\n\n'
|
2021-07-29 00:37:35 -07:00
|
|
|
}
|
|
|
|
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || wipe "$@"
|