-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwipe
More file actions
executable file
·22 lines (20 loc) · 783 Bytes
/
wipe
File metadata and controls
executable file
·22 lines (20 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env sh
# compat: +ash +bash +dash +zsh YES_BB_AWK
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.
[ $# -le 0 ] || { printf '%s\n' "$0: too many arguments" >&2; return 1; }
clear
clear # twice because mintty is weird
printf '\033[30m\033[107m\n'
if [ -n "${ZSH_VERSION:-}" ]; then
printf '*%.0s' {1..$COLUMNS}
else
tput cols | awk '{for(i=0;i<$0;i++)printf "*"}'
fi
printf '\033[0m\n\n'
}
[ -n "${preload+-}" ] || wipe "$@"