Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

April 2006
Sun Mon Tue Wed Thu Fri Sat
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Mar  May

Screen and the Benefit of a Change of Perspective

Saturday, April 22, 2006

Alan Kay once said that "A new point of view is worth 80 IQ points" and this was reinforced for me recently. Now, I have known about the Unix screen and detachtty utilities for years; however, I've always mentally just equated them as being similar utilities. I knew that screen had more features and was larger than detachtty; however, I hadn't really come up with any use cases for the extra functionality in screen (nor had I really tried to identify those use cases as my "perspective" didn't allow me to consider them). My computer had plenty of memory so I wasn't worried about opening multiple consoles. That made me miss "seeing" the utility of being able to detach processes locally and subsequently re-attach them.

Then, a few days ago I started playing around with the terminal version of Emacs. Since startup is really quick, I've started using it for some things in place of Aquamacs (the implementation of Emacs that I normally use). Now, I find myself using screen all of the time. In one screen window, I fire up a bash shell; in a second window, I run a standard terminal emacs and have it start up an IRC session. If I want to connect to a server, I create another window and SSH to the server (I may run either screen or detachtty on the server so that I can disconnect from that session separately). I switch between windows with a keystroke. When I'm finished working for the day, all I do is detach my screen sessions and quit the terminal. What's also convenient is that my server screen/detachtty sessions are detatched and can be re-attached either from my Mac or any other system that I have access to that can run screen/attachtty. This is useful if I want to check up on a server process when I'm not at my normal development machine. I chatted with Drew about this the other evening and he does this all the time; but, until I changed my "perspective", I was unable to see the real potential of screen.

I've started reading some additional material about screen to see what other features I might be able to utilize (comments/advice from others about how they use screen would be appreciated!). Here's my .screenrc file (most of which I've stolen from .screenrc files that others have posted on the net):

#kill screen's startup message
startup_message off
# define a bigger scrollback, default is 100 lines defscrollback 1024
# An alternative hardstatus to display a bar at the bottom listing the # window names and highlighting the current window name in blue. hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
# Execute .bash_profile on startup shell -$SHELL
# Use C-z instead of C-a as this makes more sense for Emacs escape ^za
# ------------------------------------------------------------------------------ # STARTUP SCREENS # ------------------------------------------------------------------------------
screen bash screen -t irc 1 emacs -nw --debug-init -f erc
It's interesting how changing one thing about the way you normally do things can change your perspective and make you see things that you didn't see before. It makes me wonder how many other things I'm not seeing!

emacs Copyright © 2006 by Bill Clementson