Sparkling gems and new releases from the world of Free and Open Source Software

CLI Upgrade

Powerline 2.5.1

If you've watched any presentations by prominent Linux developers over the past 12 months, you can't help but have noticed that many of their command prompts looked different from those of us mortals. Instead of plain old ASCII with perhaps a cleverly configured status line, you would see tiny hieroglyphics, icons, and chevrons, all rendering in 24-bit color. These colorful snippets of text and symbols update according to what the hacker is doing. While editing a text file in Vim, for example, these symbols show which mode the user is editing in, along with line numbers and document percentages. The default prompt in Bash gets visual cues that make it easier to see each command history, while even the humble Tmux gets hardware monitoring, local time, and Git repository status.

All of this is coming from a single tool called Powerline. Powerline started out as a humble status bar for Vim, adding a little visual flair and functionality without changing its classic console aesthetic. But Powerline's minimalist and functional approach was soon extended by its users to include many other command-line tools, and the project soon outgrew its text editing roots.

The new project is a unified version of the old Powerline, offering an upgraded prompt plugin for Zsh, Bash, Tmux, iPython, Awesome, i3, Qtile, and, of course, Vim. The function of the prompt will depend on where you're using it, but Powerline will typically show your current location, automatically truncated to fit whatever window size you're using, complete with icons and colors to help each session differentiate itself. However, this is just the default, and being a command-line tool, it's been designed to be modified. It's simple enough to write your own status renderer, for example, and thanks to the various configuration files and color schemes using JSON, it's easy to modify the appearance of any plugin without even delving into the code.

Installation is relatively straightforward but not simple. As a prominent Python tool that works with both Python 2.7 and Python 3.x, it can be installed from PyPI with the pip command, but you also need to install a set of the customized fonts that are used to populate the status bar itself, which is how Powerline manages to appear like a graphical shell within the shell. You then configure your respective tools by editing their configuration files, usually by adding a link the a script or environment file installed alongside PowerShell. You can then modify and augment the installation to suit how you typically use the command line. The end result is a small concession to modern screens, colors, and design but a genuine enhancement to the command-line experience, without giving away any of the command-line functionality we're all finding so refreshing after all these years of using desktops. If you find yourself using the command line more and more and need a tiny piece of eye candy to enhance the view, Powerline is a perfect addition.

Project Website

https://github.com/powerline/powerline

The project has become wider reaching, but the Vim plugin is still central to Powerline's enhanced functionality.
If you use the command line extensively, you need to install Powerline.

File Manager

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News