Feature request: Inactivity timeout
Would it be possible to implement some kind of inactivity timeout, where cpm would exit after a configurable number of seconds? I keep forgetting to exit after copying passwords.
I think yeah, that would be a good idea - especially if it were configurable.
I took a stab at your proposed inactivity timeout @jspenguin.
Try setting InactiveTimeout 5
in your ~/.cpmrc and let me know what you think.
It doesn't seem to work. I think the ptrace protection might be interfering with the alarm, because when I run it under strace, it spits out an error about not being able to enable ptrace protection, and then the timeout works.
Even if I run as root without strace, it does not work.
hm, this is possible. I am writing this on a platform where ptrace protection has been disabled due to lack of support in the kernel since most newer distro kernels no longer support tracing self by default. Which also leaves me rather unable to debug this. As you can see from the commits, I've implemented the timeout as a simple alarm() signal reset by user input. Perhaps it's the ptracing child, can you check what is interfering with the delivery of this signal?