Skip to content

Commit 9a1bb89

Browse files
committed
adds option to clear history
1 parent 12a357a commit 9a1bb89

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

instructors/terminal.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ SESSION="${SESSION:-swc}"
1616
# LOG_FILE=/tmp/my-log ./swc-shell-split-window.sh
1717
LOG_FILE="${LOG_FILE:-/tmp/$SESSION-split-log-file}"
1818

19+
#erase existing history if passed --clean_history
20+
for arg in "$@"; do
21+
if [ "$arg" == "--clean_history" ] || [ "$arg" == "-c" ]; then
22+
echo "" > "${LOG_FILE}"
23+
break
24+
fi
25+
done
26+
1927
# The number of lines of history to show. Defaults to 5, but you can
2028
# override from the calling process.
2129
HISTORY_LINES="${HISTORY_LINES:-5}"

0 commit comments

Comments
 (0)