Fun with Portable Cygwin
UPDATE: For solutions to box drawing issues, see this post.
I just spent a good 30 minutes trying to figure out why the portable Cygwin installation (I haven’t really tested the portable part yet) I was working on refused to set my custom prompt automatically.
Turns out that bash doesn’t look for .bashrc for login shells, but instead looks for .bash_profile, which is what I’m used to using. For more info, see this nice page.
As far as making Cygwin itself portable, it seems to be as simple as this article suggests, however, there are some invalid and possibly unneeded (still worked when I removed them) commands in the batch files.
Here’s the batch file I use to start rxvt (I fixed some invalid options and removed some stuff):
@echo off
for /F %%A in ('cd') do set WD=%%A
set path=%WD%bin;%WD%usr\X11R6\bin;%path%
set SHELL=/bin/bash
set CYGWIN=codepage:437
set HOME=/home/user
:: Custom font for box drawing issues (not used atm)
:: bin\run rxvt -sl 1500 -bg black -fg gray -sr -fn 'Lucida ConsoleP-13' -tn rxvt-cygwin-native -e /bin/bash --login -i
:: Normal font
bin\run rxvt -sl 1500 -bg black -fg gray -sr -tn rxvt-cygwin-native -e /bin/bash --login -i