Every developer will undoubtedly love the bash terminal of Linux and its flavors.Easy setup, autocomplete, out-of-the-box support for most day-to-day commands, console switching.
Unfortunately the Windows terminal and even the Powershell are impossible to work with on a daily basis.
This post will give a detailed analysis on how to setup your terminal for windows.
We will be using Console2 and Cygwin together to create the ultimate development environment.
Step 1: Install Cygwin
Go to https://cygwin.com/ and download the installation file depending upon your windows
Step 2: Install the following packages for it
You can initialize the setup again, Cygwin will again ask for the packages to install.
Here are the most-important packages
- Admin: cygrunsrv
- Doc: cygwin-doc
- Doc: man
- Editors: vim, nano
- Interpreters: perl
- Mail: fetchmail
- Mail: mutt
- Mail: procmail
- Net: inetutils
- Net: openssh
- Net: openssl
- Net: autossh
- Net: rsync
- Shells: bash
- Shells: rxvt
- Text: less
- Utils: cygutils
Step 3: Install Console2
Download Console2 from http://sourceforge.net/projects/console/files/
Here is the link to the latest release http://sourceforge.net/projects/console/files/latest/download?source=files
Step 4: Change Default Settings of Console2
Right-click -> Edit -> Settings.
Mostly adapted from Scott’s.
- Console:
- Shell: C:\cygwin64\Cygwin.bat
- Startup Directory: H:/ [your daily workspace]
- Appearance:
- Font: Consolas
- Size: 15
- Color: Kermit Green
- Selection Color: White
- Window Transparency: Alpha, 40%
-
Behaviour:
Tick every checkbox in Copy & Paste
-
Hotkeys:
I love the default hotkeys in default cmd of ubuntu
The most important Hotkeys
New Tab: Ctrl+T
New Tab 2: Ctrl+Shift+T
Copy: Ctrl+Shift+C
Paste: Ctrl+Shift+V
Close Tab: Ctrl+Q
Next Tab: Ctrl+Tab
Previous Tab: Ctrl+Shift+Tab
- Title: Bash
- Icon: C:\cygwin64\Cygwin-Terminal.ico
- Shell: C:\cygwin64\Cygwin.bat
Add one more tab for Bash
Done.You can now start using console2 like a pro.
Step 5: Install apt-cyg
Everyone developer loves the simplicity of apt-get install, you can have that finally for your windows laptop by using a package called as apt-cyg.
wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
mv apt-cyg /bin/apt-cyg
chmod +x /bin/apt-cyg
apt-cyg install nano
Step 5: Extra: You can even add power-cmd
Under Tabs in Settings
+Add one more tab
Shell: %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
Icon: Download http://upload.wikimedia.org/wikipedia/en/7/7f/Windows_PowerShell_icon.png and set path to it.
Step 6: Set up ssh
Right Click on Cygwin icon and select Run as Administrator
Enter the following command
ssh-user-config
- Shall I create SSH1 RSA key: No
- Shall I create SSH2 RSA key: Yes (more secure)
- Enter passphrase (like a password):
- Enter passphrase again
Done.
Step 7: For node-js Users, run dos2unix
apt-cyg install dos2unix
dos2unix /cygdrive/c/Program\ Files/nodejs/npm
References:
- http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx
- http://c2.com/cgi/wiki?BetterCygwinTerminal
- http://stackoverflow.com/questions/17825023/installing-additional-packages-for-cygwin
- http://www.howtogeek.com/howto/41560/how-to-get-ssh-command-line-access-to-windows-7-using-cygwin/
- http://infrablue.tripod.com/cygwin.html
- http://stackoverflow.com/questions/21206812/how-add-commands-to-cygwin-npm
Great post thx !