And where do you get exiting an OS? We don't know... maybe another OS...
| However, I've been toying around with the idea
| of eventually writing a minimal 'vi' clone that
| you cannot exit. I'm sure there's pent-up demand
| just waiting for one!
If a user space program can be truly unexitable without restarting (including the possibility of killing it through another shell, of course), then would you consider it to be a bug in the operating system? Seems a reasonable conclusion to me.(read linux/Documentation/admin-guide/sysrq.rst before you try this)
Just open a scratch file, enter some s-expressions, evaluate them, then kill the buffer.
Never leave your unattended keyboard and screen unlocked.
Acceptable pranks would be things like:
- innocent videos (annoying videos for toddlers etc)
- change Spotify playlist from rock to childrens songs or rickroll or something
- open MS Paint and draw something (those pranks weren't necessarily small, we got three huge monitors side by side on those workstations)
- etc
Unacceptable pranks:
- anything that wasn't possible to revert in a hurry
- anything a customer couldn't see (we were on display :-/ )
At another place I know someone sent a mail to the team from someone elses account that they would bring cake the next day.
I once burned myself by doing what I thought was the obvious thing: leaving a message in a text editor and locking the machine. Turns out for some reason he couldn't unlock it after it had been locked that way and he needed to leave the campus to have IT at the main site unlock it. (When he locked it he always did it by closing the lid instead of through the system menu.)
I think gnu screen has the right idea here: ctrl-a.
And you say z is close to control - does that mean you use emacs without shift lock as control?! (I mean sure, still closer than b...).
When I used Mac in 2009 to 2012 it depended on the application you were using:
Some used fn+left/fn+right, some used CMD+left/CMD+right and I think ctrl and/or alt + arrow keys were an option too.
ctrl a/ctrl e would work everywhere I think but I didn't use those as they didn't work with shift to select to the start or end of the line.
As a keyboard type of person this was a major part of what drove me away from Mac despite its many advantages :-(
I know, because I have triple-shift-press mapped to shift lock on my Ergodox. It's... usually better, but sometimes I type a @#$%@#$% swear word when I mean to enter a number.
C-a (like in screen) would be even better but as others have pointed out it masks going to the beginning of line which is very common.
C-z is very rarely needed. C-q/C-s would be good candidates also as I don't think I've ever needed flow control in this century nor the last one, for that matter.
Presuming Shift Lock means Caps Lock, that and Control are both close to Z on my (Apple) keyboard.
C-a does annoyingly conflict with readline's "move to start of line", though.
Obviously they could have switched before a general release, but I guess they had gotten used to it.
2. In outer tmux, ssh to some other machine you need to administrate.
3. screen because you need multiple terminal sessions on that machine, or need detachability/reconnectability for some long-running process.
Or perhaps it's 5, or 6.
I once caused a near rebellion of vi users when I was running an ISP and symlinked vi to emacs on our shell server because I was sick and tired of it...
I did something similar w/ tmux: map the prefix key to C-a and map CapsLock key to Ctrl (never found real use for it). So Ctrl-a (actually CapsLock-a) is very ergonomically pleasant.
(Although this seems to have broken in recent tmux releases on Debian (3.x?) and I haven't looked into yet.)
E183: User defined commands must start with an uppercase lettercabbrev w <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'w')<CR>
cabbrev q <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'q')<CR>
cabbrev q! <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'q!')<CR>
cabbrev wq <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'wq')<CR>
A similar optimisation was with tmux to bind the prefix to C-z. It's in a handy location next to ctrl and I very rarely use suspend anyway (which is still available as easily as C-z z). Stretching your fingers between ctrl and b (the default prefix key) merely made me wonder who the heck thought of something like this?
As for vi, I made a point of learning to use it enough to do useful work editing config files and small texts. Every once in a while another application brought up 'vi' for some reason (maybe I lost VISUAL or EDITOR while sudoing or the app was looking for another variable) and I could never exit the damn thing.
So instead of just learning :q and figuring out how to make the particular program or script relaunch another editor I thought it's the path of least resistance to just edit with vi directly. It has been an incredibly handy skill: I never use vi for anything larger but these days I actually do 'vi /etc/fstab' myself instead of calling for emacsclient.
However, I've been toying around with the idea of eventually writing a minimal 'vi' clone that you cannot exit. I'm sure there's pent-up demand just waiting for one!