Saturday, May 12, 2018

The command-line GUI

To achieve an efficient and functional UNIX command-line interface should be easy, but that's not always the case, because of the myriad of options and personal tastes, needless to say the many specific scenarios with unique requirements that may come into play.

On the seek for the "perfect terminal" I actually like to combine three things:

  • GNOME terminals
    The fundamental underlying GUI terminal.
     
  • Terminator
    The fundamental GUI window multiplexer.
     
  • GNU screen
    The fundamental underlying shell process preserver. 
     
It would be nice to have each of these things strongest points into a single piece of software, but unfortunately that's not the case in the real world. It's interesting to note that each of these things try to compensate its weakness, but they never (or perhaps hardly) achieve the combined results of them:

  • GNOME terminals can't split their window into multiple terminals. The best they can do is to create multiple (vertical) tabs.
      
  • Terminator can't provide a separate shell process decoupled from the terminal, which is of paramount importance when one have something really important happening on the shell.
      
  • Finally, GNU screen can't provide a satisfactory GUI experience. For instance, its scollback is awkward as well as its GUI copy/paste when the terminal is split into multiple regions.

Hence, for instance, when properly configuring Terminator as the middleware between GNOME terminals and GNU screen sub-processes one will end with something similar to the as follows for 2-split GUI window:

$ ptree $(pgrep terminator)
 

2510  /usr/bin/python2.7 /usr/bin/terminator

  2512  gnome-pty-helper


  2514  /opt/gnu/bin/screen
    2515  /opt/gnu/bin/screen
      2516  /usr/bin/bash


  2520  /opt/gnu/bin/screen
    2521  /opt/gnu/bin/screen
      2522  /usr/bin/bash


Unfortunately, Solaris isn't very much concerned on its front-end, hence the available GNOME and Terminator versions are rather old in comparison to the current ones. But that isn't really an issue for an OS which strives to shine (and it really does) on the back-end.