mirror of
https://github.com/Phantop/dotfiles
synced 2024-12-29 08:16:52 +00:00
19 lines
470 B
Fish
19 lines
470 B
Fish
|
function record
|
||
|
set recfile /tmp/fish_$fish_pid\_$(date +%s.%N)
|
||
|
set -g --append recfiles $recfile
|
||
|
set -g --append reclines "$argv"
|
||
|
set -g --append recfolds $PWD
|
||
|
|
||
|
if test (type -t $argv[1]) = file
|
||
|
script -efq $recfile -c "$argv"
|
||
|
else
|
||
|
script -efq $recfile -c "fish -c '$argv'"
|
||
|
end
|
||
|
|
||
|
zstdmt -c $recfile &| sponge $recfile
|
||
|
|
||
|
function rmrec_(basename $recfile) --on-event fish_exit -V recfile
|
||
|
rm $recfile
|
||
|
end
|
||
|
end
|