I have a Mac with snow leopard. I often work off the terminal using tmux (or GNU screen) When I walk away I remote ssh back to my computer. The thing is sometimes I have to step away from the computer for a minute or two. When that happens I don’t want people to glance over and have access to my command line and I also don’t think it is worth the whole CTRL-a,d,exit,open terminal, ssh to machine, tmux attach each time that happens.
Screen offered a CTRL-a,x that locked the screen (provided I enter in a password at least once that session because it won’t read the system password) or in tmux (preferred) a clock feature.
All the documentation points to the fact that the multiplexers look for /usr/bin/lock or /usr/bin/lck. Since that is a low level utility found on linux and BSD systems where can I find the source so I can port it to Mac OS X?
tmux comes from OpenBSD; you can view its lock through OpenBSD CVSweb for
src/usr.bin/lock/.Mac OS X is more closely related to FreeBSD; you can view its lock code through FreeBSD SVN ViewVC for
head/usr.bin/lock/(CVS and Perforce are also available).Either one will require modification to even compile on Mac OS X.
A major functionality difference will be in the authentication method for the
-poption (“use login password/authentication”): the OpenBSD code uses its own authentication system, and FreeBSD uses crypt(3) which will not work for most Mac OS X accounts.