Greetings fellow Microsoft Windows users and developers! If you are not aware, I recently made the switch from OS X to Microsoft Windows and promised to blog about my journey along the way, especially if I found new and exciting tools that I feel will help the OpenShift developer population as a whole. In case you missed my first post that specifies what tools I am using, you can check it out here:
https://blog.openshift.com/getting-productive-with-openshift-on-windows/
One of the readers (Boris Kurktchiev) was kind enough to post a comment suggesting that I try out the Babun shell. I am happy to report that I not only tried it out, but I integrated it with ConEmu to create what I think is a top-notch shell for working with OpenShift and git based projects. In this post, I will explain how I got everything working.
Okay, let’s get started. First of all, what is Babun shell? Well, the creators of the project state that Babun is a Windows shell that you will love. I can't say that I disagree with them as I do indeed love it so far.
Step 1: Download Babun
The first thing you will want to do is download the shell at http://babun.github.io/ This will download a zip file of the shell on your local file system. Once you extract the zip archive using file install, I suggest you install it using the install.bat file. In my case, I wanted to install it to my C:\babun
directory so I executed the following command:
C:\downloads\Babun\install.bat /t “C:\babun”
Step 2: Integrate it with ConEmu
The default shell application window that ships as part of Babun is a little lacking when it comes to features. I much prefer a terminal that supports tabs, font resizing on the fly, etc etc. If you recall from my first Windows blog post, I truly enjoy using ConEmu. Luckily, it is a pretty easy task to use Babun as the default shell for ConEmu based sessions. To do this, open up the settings window of ConEmu and select Tasks located under the Startup section. This is shown in the following image:
Click the + sign under the tasks to create a new one. A few things you will want to enter here:
- Give the task a name of “Babun”
- Enter the following for the task parameters:
/icon "%userprofile%.babun\cygwin\bin\mintty.exe" /dir "%userprofile%" - Enter the following for the Start section:
C:\babun.babun\cygwin\bin\mintty.exe - -new_console:a
The last part in section 3 above will start each new console as "Administrator". If you don’t want to do this, leave the -new_console:a
off.
Once complete, it should look like this:
Perfect! You now have Banbu up and running and integrated with ConEmu.
Step 3: Installing ZSH completions for OpenShift 3
Now that we have ConEmu up and running and configure with Banbu, the next thing we want to do is set our theme and enable OpenShift 3 tab completion. Open up a new ConEmu session and it will drop you in your cygwin home directory.
Pro Tip: If the font size it too small for your liking, a quick way to change it is hold down the control key and use your mouse scroll wheel to enlarge the font.
Edit your .zshrc file with the following command:
[~]$ vi ~/.zshrc
Look for the following line:
ZSH_THEME=”babun”
and change it to the following:
ZSH_THEME=”eastwood”
Okay, you got me there. Why do you have to change it? Well, you don’t. I just personally like the eastwood theme better but you can use whatever theme strikes your fancy.
Exit out of the VI session and enter in the following command to clone the git repository that contains the ZSH tab completion information:
git clone https://github.com/chmouel/oh-my-zsh-openshift ~/.oh-my-zsh/custom/plugins/oc
After the repository has been cloned, you will need to edit your .zshrc file once more to load the plugin.
vi ~/.zshrc
Look for the following line:
plugins=(git)
and change it to:
plugins=(oc git)
save your changes and create a new shell session to ensure that your .zshrc file is sources properly.
Step 4: Bask in your oc tab completion glory
You now have tab completion working inside of your bright and shiny new shell. Try it out by typing oc lo
(and then hit the tab key).
Pretty fancy huh?
Wrapping up
Okay, a few other things you will need to show when using Babun:
To see what shell you are currently using, enter in:
babun shell
To change your default shell to zsh (bash is also supported)
babun shell /bin/zsh
To install new packages
pact
To install cygwin ports (example bash-completion 2.1)
pact install bash-completion -m ftp://ftp.cygwinports.org/pub/cygwinports
I have found that installing things when not running as administrator breaks things horribly.
About the author
More like this
Browse by channel
Automation
The latest on IT automation that spans tech, teams, and environments
Artificial intelligence
Explore the platforms and partners building a faster path for AI
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
Explore how we reduce risks across environments and technologies
Edge computing
Updates on the solutions that simplify infrastructure at the edge
Infrastructure
Stay up to date on the world’s leading enterprise Linux platform
Applications
The latest on our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Developer resources
- Customer support
- Red Hat value calculator
- Red Hat Ecosystem Catalog
- Find a partner
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit