Skip to content

Commit b00567b

Browse files
committed
Add bash/zsh/fish init scripts, direct to them instead of copy
1 parent 6cf3e37 commit b00567b

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

init.bash.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
TAVATAR_LOG=~/.tavatar_history
2+
3+
BASH_LOG=~/demos.out
4+
bash_log_commands () {
5+
# https://superuser.com/questions/175799
6+
[ -n "$COMP_LINE" ] && return # do nothing if completing
7+
# don't cause a preexec for $PROMPT_COMMAND
8+
[[ "$PROMPT_COMMAND" =~ "$BASH_COMMAND" ]] && return
9+
local this_command=`HISTTIMEFORMAT= history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//"`;
10+
echo "$this_command" >> "$TAVATAR_LOG"
11+
}
12+
trap 'bash_log_commands' DEBUG

init.fish.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAVATAR_LOG=~/.tavatar_history
2+
3+
function cmd_log --on-event fish_preexec ; echo "$argv" >> "$TAVATAR_LOG" ; end

init.zsh.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAVATAR_LOG=~/.tavatar_history
2+
3+
preexec() { echo $1 >> "$TAVATAR_LOG" ; }

0 commit comments

Comments
 (0)