Coding 22 Mar 2007 10:51 am

Cygwin/Bash Tips (#1?)

Bash History
This post turned me onto the fact that the bash history is actually relatively powerful - moreso than I thought at first. You can use positional references and regular expressions much like in a vi command. The bash man page on the subject has all of the options, but no examples, which is probably why I skimmed over it before.

Screen in Cygwin
I’ve been using screen for years in linux to help manage multiple windows, and processes which I want to persist between login sessions (either long running processes that I want to be able to check in on, or things like irc which I dont want to have to disconnect/reconnect all the time). I’m sort of limited on the boxes I have access to lately, but I have the whole cygwin suite set up on my home machine, so I’m using that as a viable alternative. The bummer is, screen is not one of the officially supported packages by Cygwin. There have been a few patches and builds of screen, and the one I’ve found works the best is this version of 3.9.15.

This comes with a caveat though. For whatever reason, regular ‘reattach’ (-r) doesnt work under cygwin, but the flag to login to an existing attached session (-x) seems to always work (Thanks for the tip). So where I used to use ’screen -r’, I now use ’screen -x’ and it seems to work nicely.

[Update]: After using it for a while, it looks like a non-forced disconnect (like SIGHUP from the ssh session going away) puts it in the same state as screen -r (it’ll just sit there). Worse, it looks like it’ll detect the session as dead potentially. I’m looking into this. If anyone out there has info please let me know!

I’ve got some more tips on how to use Cygwin, but I’ll have to add those later.

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply