cpm icon indicating copy to clipboard operation
cpm copied to clipboard

Feature request: Inactivity timeout

Open PinkPandaKatie opened this issue 10 years ago • 4 comments

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.

PinkPandaKatie avatar Jul 14 '15 14:07 PinkPandaKatie

I think yeah, that would be a good idea - especially if it were configurable.

comotion avatar Jul 15 '15 11:07 comotion

I took a stab at your proposed inactivity timeout @jspenguin. Try setting InactiveTimeout 5 in your ~/.cpmrc and let me know what you think.

comotion avatar Jul 15 '15 15:07 comotion

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.

PinkPandaKatie avatar Jul 15 '15 15:07 PinkPandaKatie

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?

comotion avatar Jul 17 '15 01:07 comotion