Reimagining the Virtual Desktop
A new Linux terminal emulator tries to bring the command line into the 21st century and bridge the gap to the graphical user interface.
Terminal emulators have existed as long as the Linux desktop, representing the command line on the desktop. However, although they have been integrated into the desktop with tabs and copy and paste commands, in other ways. they are identical to the command lines of the 1970s. Now Philipp Emanuel Weidmann is hoping to change that with Final Term, a project that provides an enhanced command line that takes full advantage of graphical interfaces.
Weidmann is a graduate of the University of Heidelberg with a major in mathematics and a minor in philosophy. Although he describes himself as “a Java EE developer,” he also has experience in web and application development and database design. Final Term is his first open source project, written in Vala and using the Gtk+ toolkit.
Weidmann’s thoughts about the command line begin with him noting that “one of the classic tenets of the Unix philosophy, usually attributed to Doug McIlroy, is, “Write programs to handle text streams, because that is a universal interface.” However, he adds that, in reality, an unstructured text stream is “everything but a universal interface” and that a command line written today from scratch would probably use some form of structured data.
However, such a rewrite, he acknowledges, is unlikely to happen – over several decades, the command line “has amassed a fundamentally flawed but highly reliable and efficient ecosystem that is likely to rule Unix administration for more decades to come.”
Final Term is an effort to bridge this gap between what Weidmann thinks a command line needs to be and what it is likely to remain: “an xterm-compatible terminal emulator that uses some sophisticated trickery to add a semantic layer on top of the unstructured shell output so that the shell user can move to the 21st century while waiting for his shell to do the same.” Final Term was inspired by Steven Wittens’ TermKit, but Weidmann considers TermKit “too far ahead of its time” to be an option for most users.
Weidmann began Final Term in 2012 as a project in his spare time. In April 2013, he put the project on GitHub. After a month of seeing it be ignored, he tried to create some social media buzz. His effort was so successful that Final Term now has “more than a dozen” contributors. “Some of the most important architectural changes that Final Term has seen since its release, such as porting the build to CMake and making the strings localizable, were done by other people,” he says. “Which is great because I lack experience with the underlying technologies.”
Exploring Final Term
Final Term is currently in pre-alpha release. The general release, according to Weidmann, will add tabs and copy and paste functionality, but in other ways it is advanced and stable, considering its present state, with many of its unique features already implemented and stable.
Source code is available on GitHub, but the easiest way to install Final Term is with the Ubuntu packages on Launchpad. The interface appears designed for Unity, so configuration options are available by right-clicking on the application in the title bar.
Right away, you will notice that you can use the mouse as well as the keyboard to navigate Final Term. However, the best way to begin exploring other features is to watch the video on the project’s front page, then scroll down the page’s list of features. After you type at the command line, the first feature you are likely to notice is that the output at each prompt is collapsed so that only the initial command displays (Figure 1). You can use the arrows on the side of the window to expand or collapse each section of output. It is a simple feature, but one that vastly speeds scanning the previous display.
The next thing you might notice is the smart command completion (Figure 2). Many shells boast this feature, of course; however, what makes Final Term’s implementation powerful is that suggested completions are in a drop-down list that includes all possible completions listed in your history, sorted by probability.
Similarly, Final Term recognizes common features of output, such a file names, URLs, and IP addresses. Right-click on an item in the output, and you are offered a list of possible commands (Figure 3). For example, for a URL, the options include Copy URL to clipboard and Open URL in browser, whereas options for a file include displaying attributes, copying or moving, and opening in an editor.
Final Term includes other features, such as the ability to drop down from the top of the desktop and to reflow – that is, to rewrap lines when the window size changes. Other features include choices for key binding and color coding (Figure 4); the selection of colors and themes offer more choices than in other terminals, but otherwise they are fundamentally the same.
However, what stands out is the collapsible prompts and the drop-down lists of command completions and command options. Like the Bluefish text editor, these tools remove the drudgery of entering standard or repetitive commands manually while leaving users always able to see what is happening and to control things. This can be a difficult place for an application to position itself, but it often makes for the most efficient tools, and Final Term is no exception. In doing so, it makes itself feel more like a desktop tool than any other terminal emulator I have seen – all without simplifying or hiding input or output from the user.
“The biggest challenge left in Final Term’s development,” Weidmann says, “is the most basic feature of any terminal emulator: interpreting the xterm control sequences.” He explains that most Gtk terminals are built on top of VTE, which simplifies their development. However, because Final Term includes (or plans to include) some unique features, “it must indeed reinvent the wheel in many ways.”
To some extent, working with free software helps the project. In fact, according to Weidmann, “without access to the source code of other terminal emulators, writing a new one would be downright unthinkable.”
Even so, code borrowing is rarely an option. “It doesn’t help that most terminals that have been in development for a while have grown into unmaintainable monstrosities,” Weidmann says. “Even simple terminals commonly have 10 times as many lines of code as Final Term has right now.”
Weidmann blames this bloat on the C programming language that many terminals use, “which makes it hard to build a proper model of anything.” He hopes to do better with Vala, which, while “far from perfect, allows for much cleaner separation of concerns and a solid foundation that will enable easy maintenance and extensibility in the future.”
As with many projects, Final Term’s roadmap is vague. Weidmann hopes for at least a beta release some time in 2013 and to be ready for distributions in 2014. An OS X port is also being done, while queries from early adopters suggest that a Qt port might be more or less inevitable.
Asked about Final Term’s intended audience, Weidmann’s first response is “Definitely everyone!?” He continues: “Final Term can act as a nice learning environment for command-line neophytes, but even greater is the impact it can have on a power user’s productivity and speed. Autocompletion in particular accelerates finding the desired command enormously and usually reduces it to typing one or two letters, the down arrow, and enter.” Indeed, Final Term’s eventual (though not exactly humble) goal is to make obsolete all other terminal emulators in use today and become the default terminal in the majority of Linux distributions (at least those based on Gtk+).
Judging from some of the grumblings, Final Term may face a hard sell appealing to some long-time Linux users. “Too much reliance on graphical elements and the mouse,” one commented. “Curses and keyboard only or it doesn’t happen.”
For new users or those less confirmed in their habits, though, Final Term just might be the application that proves the continued relevance of the command line. Its development and degree of acceptance should be interesting to track in the next year or so.
Linux Foundation's big event celebrates the 25th anniversary of Linux
Competitors get in the game with RHEL without Red Hat
Security researchers have already notified Microsoft; some fixes are available
The company is collaborating with Google and Intel to use Kubernetes as an engine for Fuel
Customers can take a free test drive of SLES for HPC on the Azure Cloud
San Francisco-based chip company announces their first fully open source chip platform.
The whole distro gets rebuilt on glibc 2.3
Ubuntu Vendor tries to solve app packaging and distribution problem across distributions.