aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/plugins/output-operations.zsh
blob: e9b3546574818ac73eead0d50a3062537c19b2e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# TODO

# logoutputdir=$(mktemp -d /tmp/zsh-output-operations.XXXXXXXX/)

output-file() {
  local termid=$(tty | sed 's|/|-|g');
  echo "$logoutputdir/last-output-$termid";
}

xz() {
  "$@" |& tee $(output-file);
}

# Cleanup
function plugin-exit-handler {
  rm -f $(output-file);
}

# trap plugin-exit-handler EXIT