Defaulting to the bash shell

A comment on a previous post got me thinking — why do I always drop to a Windows command prompt?  Why don’t I make more use of the Cygwin bash shell?  The shell script language is more structured than batch files (more flow control options, etc.)…

I decided to change over to using a Cygwin bash shell as the command prompt my keyboard shortcut is set up to drop me to.  At some point, though, all the output in the shell was colored blue.  Not liking this, I searched around and ended up with a better solution than I expected to get.

rxvt

I used Daniel Ambrósio’s customization of Eric Dobbs’ Cygwin + Rxvt post, to use rxvt instead of the Windows command prompt as the virtual terminal for Cygwin.  I followed these steps:

  1. Used the Cygwin setup program to install the rxvt package
  2. Created .Xdefaults as Ambrósio suggests:
    ! ~/.Xdefaults - X default resource settings
    Rxvt*geometry: 120x60
    Rxvt*background: #000020
    Rxvt*foreground: #ffffbf
    !Rxvt*borderColor: Blue
    !Rxvt*scrollColor: Blue
    !Rxvt*troughColor: Gray
    Rxvt*scrollBar: True
    Rxvt*scrollBar_right: True
    Rxvt*font: Lucida Console-12
    Rxvt*saveLines: 10000
    Rxvt*loginShell: True
    ! VIM-like colors
    Rxvt*color0: #000000
    Rxvt*color1: #FFFFFF
    Rxvt*color2: #00A800
    Rxvt*color3: #FFFF00
    Rxvt*color4: #0000A8
    Rxvt*color5: #A800A8
    Rxvt*color6: #00A8A8
    Rxvt*color7: #D8D8D8
    Rxvt*color8: #000000
    Rxvt*color9: #FFFFFF
    Rxvt*color10: #00A800
    Rxvt*color11: #FFFF00
    Rxvt*color12: #0000A8
    Rxvt*color13: #A800A8
    Rxvt*color14: #00A8A8
    Rxvt*color15: #D8D8D8
    ! eof
  3. Created my cygwin.bat replacement, calling it cygwin-rxvt.cmd
  4. Placed a shortcut to cygwin-rxvt.cmd on my desktop and modified gave it the keyboard shortcut that had formerly launched a Windows command prompt (to get me in the habit of using this)

The rxvt terminal is resizable in the horizontal and vertical direction without having to go to the system menu, properties, and looks pretty nice!  Maybe now I’ll more easily notice when a problem would lend itself to being solved by a shell script.

Finally, Ben sends a link to the Advanced Bash-Scripting Guide — thanks!  Looks like a good resource I’ve been missing.

Advertisements

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s