Most of the traffic to my blog is from search engines for a few informative posts that I made a while ago. So here goes my attempt at "informative posts" with the sole selfish intention of increasing my blog traffic. This blog is going to be lesser of a rant corner and turn more into the technical flavour it was initially intended to be. I hadn't been the biggest fan of Windows through college. But now I use Windows a lot. I am going to writing a series of posts over the next couple of weeks detailing the steps for hardcore unix users to make his/her life comfortable in the Windows world.
In this post, I will detail how to bring the familiar unix commentsand line shells and utilities to your windows desktop. There are two ways to achieve this, the first is to install the Microsoft Services for UNIX package, and the other is to install Cygwin. I am not familiar with the former, but I believe Cygwin is a more comprehensive solution.
- Cygwin is a unix shell emulator for Windows. You can get your copy of Cygwin from http://cygwin.com. Run the Setup.exe file from the site, choose "Install from Internet", and choose a nearby mirror.
- In the package choosing dialog, select applications you think you would need. I would suggest that you also additionally select the X11 system, GNU Screen, the rxvt terminal emulator and the zsh shell. After selecting the packages, go and get more than 1 cup of coffee, for it takes ages to finish the download and install.
- If you are running Windows Vista, you have 1 more additional step to get cygwin running fine. Open commentsand prompt, go to your cygwin installation directory, and run "bin/ash" (without the quotes). This will start the ash shell. Now, from the ash prompt, run "bin/rebaseall" (again without the quotes). You can then quit the shell by typing exit at the ash prompt. If you do not do this, you might face memory protection problems when launching cygwin applications.
- Now that you have cygwin running in a hale and healthy manner, we need a nicer terminal to run cygwin in, rather than the ugly cmd.exe. Browse over to http://en.poderosa.org/ and install Poderosa, for a tabbed and resizeable cygwin terminal. I would dubb Poderosa the best thing since sliced bread but then you wouldn't believe me till you try it yourself.
- Now, open Poderosa. Select File->New Cygwin Connection... In the dialog that appears; if you want to work with bash, then just hit OK, and you will be presented with a bash shell. Or if you want to use zsh (or any other shell), select Advanced configuration and change the shell from /bin/bash -i -l to /bin/zsh -i -l and hit OK.
- Now, that cygwin and poderosa are setup, we just need to get some config files set right. You will see a warning message appear on the shell, when you initially start it. http://www.cygwin.com/cygwin-ug-net/using-utils.html suggests that you run the following commentsand to solve this.
mkgroup -l > /etc/group
If you are on a domain, add a -c option to the above commentsands
mkpasswd -l > /etc/passwd - As to what are the advantages of Poderosa:
- Resizeable windows
- Tabbed interface
- Vertical and Horizontal splitting of the screen
- Plugin based architecture
- Supports SSH connections, so it can also replace putty
- However, if you don't like Poderosa, but still want a terminal better than cmd.exe, run rxvt from the the commentsand line, to get the rxvt terminal. While, I will keep details of configuring rxvt for best benefits to a later post, it would do good to know some basic info about rxvt beforehand, for instance pasting in rxvt is accomplished by the key combination Shift+Insert.
- One last tuning tip, is to add the Cygwin bin directory to your Windows PATH variable. To do this, right click on My Computer, choose the Advanced tab, click Environment Variables. Under the System Variables pane, select Path and click Edit. At the end of the Variable Value string, add a semicolon(';') and type in the installation path of Cygwin followed by a "\bin". For example, add ";c:\cygwin\bin" (without the quotes). Click OK through all the dialog boxes. And, now you will be able to access Cygwin utilities from the the Windows (dos?) commentsand prompt too.
Planned posts in this series include Tuning X11 for cygwin, rxvt for Windows, ZSH for productivity, Tuning GNU Screen for commentsand line geeks and Explaning my Emacs configuration.
Share this post:Design Float | StumbleUpon | Reddit | Delicious | Facebook | Google Bookmarks
Original comment by :Vijay
So true! The following happened so many times:
Casanova: Dei do u have this feature on your box?
Me: Nope
Casanova: Dei your windows box so sucks
:P
Now,
Me: You use Windows!!??
Casanova: ah, windows :)
Ironical that the guy who introduced me to linux now uses windows :)
Original comment by :Aravind Narayanan
Windows and Linux boxes are just that - boxes.
A Mac computer is a piece of art - elegant, beautiful and efficient. A perfect melding of software and hardware to produce the ultimate computing experience.
Original comment by :wcyee
I don't want to replace the Consolas, because it looks fine when I'm using Visual Studio, but a bit strange CMD.exe or Poderosa. Making it bold works out well in the latter cases. I've got clear type enabled on my WinXP machine, so that's not an issue. Anyway, I don't know enough about fonts and displays to make an intelligent diagnosis. But I'll try poking around the Poderosa config and registry to see if I can get it to recognize Consolas bold. Thanks anyway!
BTW, in case it matters, I'd love to read your writeups on zsh and emacs config. :-)
Original comment by :prashmohan
I use the Monaco font. And no I don't see an option to make the fonts bold either. Perhaps you could try replacing the Consolas font with the Consolas Bold font (i.e. only if you dont intend to use the Consolas regular font). Maybe it will trick Poderosa? :-)
Original comment by :prashmohan
I have a mac. But no, I did not get the "ultimate computing" experience.
What makes the Mac good is the unix core, what makes the mac better is macports and what makes the mac great is QuickSilver.
Beauty is just skin deep you know :-). But jokes apart, the real differentiator for the mac is their well defined and uniform HIG (Human Interface Guidelines)
Original comment by :wcyee
BTW, do you notice any graphic display problems when you run Poderosa? Every now and then there's a random pixel that lights up on the terminal, which goes away. Nothing serious, but just a little annoying.
Also, have you found a way to add more fonts? I use Consolas for my CMD and it turns up in Poderosa, but unlike CMD, there's no way to choose a Bold Consolas.
Just thought I'd ask in case you've run into either issue. Questions in the Poderosa forums don't seem to get very many replies (actually, none for the most part).
Thanks for your writeup!
Original comment by :wcyee
The change I made was in the other field - home directory. Poderosa defaults to /home/username but my real home directory, as configured in /etc/passwd is the same as my windows home directory. Logging in using bash.bat worked fine, but Poderosa kept sending me to /home/username (unless I manually changed it). It's entirely possible it remember changes made to the shell (bash to zsh, as in your case).
Anyway, I figured out how to fix this:
In "Poderosa\Cygterm\cygterm.cfg", I changed the "ENV_2" variable to reflect my root for home directories, and all is good.
Thanks for replying to my commentsent.
Original comment by :Prashanth
As a student, I was broke and couldn't afford to buy software. The other reason I used FreeBSD and Linux was from a purely academic motivation. Now that I am _in_ microsoft, I have the same freedom with Windows as well.
Perhaps, I have graduated to think of Operating Systems as just another tool :-).
Original comment by :Vijay Dev
"But now I use Windows a lot."
Not one sane person who knew you in college would have dared to imagine this kind of a statement from you :) But hell, its true !!
Original comment by :Vijay
Couldn't agree with you more about the fewposts-moretraffic thing. All my traffic comes from 2 posts i wrote :)
Cool article! Can't wait for the one on Emacs!
Original comment by :wcyee
"Or if you want to use zsh (or any other shell), select Advanced configuration and change the shell from /bin/bash -i -l to /bin/zsh -i -l and hit OK. "
Is there a way to get Poderosa to remember this? Just trying to find a way to not go through the click "Advanced configuration" and change info every time I start a shell.
Thanks.
Original comment by :prashmohan
Poderosa remembers my config every subsequent time. Does it not do so for you?
Original comment by :sp2hari
Nice article :) Was searching for a terminal better than the default one. :)
Perhaps, I have graduated to think of Operating Systems as just another tool :-).
how friggin true and down to earth, i once cheated a chap for some porn cds for windows 98 original cd with key. and then i downloaded rh 7.0 and i used it. i felt just one major difference between windows and linux/BSD. when installing windows in stage one? you will see "this may take several minutes." meaning the OS is made so dumb that it may take several more minutes to adjust with a basic block head may be more and in rh7 after 18 tries in one day on a p3 866 mhz i finally succeeded. so i concluded myself? "any operating system is just a tool which lets you adapt with the moronic world." and i said it when after 11 attempts i couldnt install and 12 th was a success and 17 th was the last failure attempt to bring X up. phew. tough night. since then affair with different OS is natural (geeky porn?) may be. wish i was well aware of cygwin then.
anyway sup "mongrel", you still run away from girls like you did in spencer's plaza? ;-) hehehe now here is one one secret which none of you knew about this chap. hehehehe. later in freenode! ciao! dunno if nick is still valid.
"thousand step journey has begun with 2 steps ahead of initial step. " - unknown
Post a Comment