mcfly
mcfly copied to clipboard
mcfly.bash leaves behind the /tmp/ temporary files
$ ls -la /tmp/mcfly.* |wc -l
130
/tmp
should get cleaned up on restart.
We talk about large amounts of tmp files, in the magnitude of thousands.
Huh, that's odd. Are you opening and closing many terminal windows?
Ermm... yes? :-)
$ ps awuxf | grep xterm|wc -l
64
Hmm, if you close terminals with exit
, we could do this:
function mcfly_cleanup {
if [ ! -z "${MCFLY_HISTORY}" ] && [[ -f "${MCFLY_HISTORY}" ]]; then
rm "${MCFLY_HISTORY}"
fi
}
trap mcfly_cleanup EXIT
If you use the UI, though, I'm not sure how to hook into cleanup. On my Mac, closing a Terminal doesn't seem to run .bash_logout
. What about on your system?
Nope, there is no sign of it in strace, either.
trap
works well, and I guess it works in most (all?) shells, not just bash.
Currently I have 14 mcfly.*
files in /tmp
. All of them have today's timestamp. It's first time I'm noticing it but doesn't mean much as I do not check /tmp
that often :) .
Using McFly 0.3.5.
These should get cleaned up when your system is restarted, right?
They did but immediately after booting there are bunch of new ones.
Are they all identical?
no, each is different (not sure about each, I compared random few which were different)
It would be nice to include the cleanup function and trap in the bash code generated by mcfly init bash
.