My Adventures in Coding

June 7, 2015

Console2 – Mac(ish) terminal on Windows using Console2 and UnixUtils

Filed under: Windows — Brian @ 6:52 pm
Tags: , , , , ,

If you are like me and you are used to using a terminal window on a Mac, using the Windows command prompt can be a bit frustrating. I like having basic functionality like tabs, short cuts to switch tabs, cut and paste with Ctrl+c and Ctrl+v, dragging the corner of a terminal to resize, all of which I take for granted on my Mac. Fortunately, Console2 and UnixUtils can help (with a little customization).

Console2 is an open source project that provides a tabbed version of the windows console app. However, it is much more than that. Even though the default settings are less than desirable, Console2 is highly customizable. So you can easily change the defaults to have all kinds of amazing features such as “select to copy”, Ctrl+c to copy, Ctrl+v to paste, drag the corner of the window to resize it, short cuts to open new tabs, switch tabs, etc. Yep, you can make it function like a normal command prompt!

Download Console2

Download the zip file, extract it, and run Console2.exe.

Console2

So far it does not look like much of an improvement, but don’t worry, we have some customizing to do.

Go to Edit -> Settings

“Console” – set the Buffer size rows to something larger, such as 9999:
2-GeneralConsoleSettings

“Appearance” – customize the font, font size, and text colour. I like Consolas, 12 point font, and a nice green text colour to remind me of the default on my Mac.

3-SetFontTypeSizeAndColour

“Appearance -> More” – hide the toolbar and status bar, ensure tabs are displayed, and set some cool transparency.

4-Appearance-More

“Behaviour” – ensure “Copy on select” is checked. This will allow you to select text on the console window and have it automatically put on the clipboard (Woohoo!).

5-Behaviour-CopyOnSelect

“Hotkeys” – set the “New Tab 1” hotkey to use Ctrl+T.

6-HotKeys-SetNewTab

“Hotkeys” – set “Copy Selection” to Ctrl+c.
7-HotKeys-SetCopy

“Hotkeys” – set “Paste” to Ctrl+v.
8-HotKeys-SetPaste

“Hotkeys -> Mouse” – set “Copy/clear selection” to “None”.
9-HotKeys-Mouse-SetCopySelection

“Hotkeys -> Mouse” – set “Select text” to “Left”.
10-HotKeys-Mouse-SetSelectText

“Hotkeys -> Mouse” – set “Paste” to “Right”.
11-HotKeys-Mouse-SetPasteText

“Hotkeys -> Mouse” – set “Context menu” to “None”.
12-HotKeys-Mouse-SetContextMenu

“Tabs” – select “Console2” and set style to “XTerm”.
13-Tabs-Console2-XTerm

Now, here is where we get to the really cool part of Console2. Besides just having a windows console tab, you can also create tabs for any other console apps such as Cygwin, Gitbash, and PowerShell.

To show you how to setup a second type of command prompt, lets use PowerShell as an example.

“Tabs” – select “Add”
14-Tabs-AddNew

Enter a name for the new Console window (“PowerShell”), set the path to the PowerShell executable, and add an icon.
— %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe

15-Tabs-AddPowerShellTab

Now you will see both “Console2” and “PowerShell” in the list of types of available tabs.

Of course, also install UnixUtils as well to make your life a little easier. To install UnixUtils, all you have to do is download the zip file, unzip it somewhere, such as “C:\UnxUtils” then add to your path “C:\UnxUtils\bin”. That is all, then you should have all of your favorite commands such as “ls” and “grep”.

Finally, a somewhat functional command prompt!

16-Done

Enjoy!

Blog at WordPress.com.