<< Introducing David Marginian | Home | Collaboration in Bespin >>

Command Lines

When I was fresh out of college, my first job was working for the OpenGroup, and my command line looked something like this:

In 2009, fired by the white heat of years of cutting edge research and development, my command line looks a lot more like this:

To be fair, we've now got transparency, anti-aliasing, our shells now do better completion. But that's about it for changes. Considering how much the rest of the industry has changed, that's shockingly glacial.

For the past week or so, I've had the privilege of working on the Bespin command line, and I think there's a lot that we can do to make things better.

This is what my Bespin command line looks like now:

This post is all about how we can make command lines better.

The core of the unix command line philosophy seems to be: small programs and pipe. There’s a lot to be said for loose coupling but there are some drawbacks as well...

Zsh

I love Zsh, and love the fancy completion that it does. Basic file completion has been around since ksh, IIRC:

$ ls [TAB]
Applications/  Mesh/       Projects/
Desktop/       Movies/     Public/
Documents/     Music/      Sites/
Downloads/     Parallels/  backup/
Library/       Pictures/   bin/

But zsh can complete against more than just files:

$ telnet [TAB]
192.168.0.1
192.168.0.12
download.directwebremoting.org
download.dojotoolkit.org
getahead.org
hg.mozilla.com
localhost
people.mozilla.com
sandbox.dojotoolkit.org
svn.directwebremoting.org

Zsh knows that you don’t telnet to a file, so it completes against hosts (Does anyone know where that host list came from BTW?)

Zsh also knows about other commands:

$ git [TAB]
add                 -- add paths to the index
apply               -- apply patch on a git index file and a work tree
applymbox           -- apply patches from a mailbox
applypatch          -- apply one patch extracted from an e-mail
archimport          -- import an Arch repository into git
bisect              -- find the change that introduced a bug
branch              -- create and show branches
checkout            -- checkout and switch to a branch
cherry              -- find commits not merged upstream
cherry-pick         -- cherry-pick the effect of an existing commit
clone               -- clones a repository into a new directory
commit              -- record changes to the repository
...

That list of commands is the result of a 'git help' command, but that's not what I typed. Zsh has been doing something funky behind my back when I pressed [TAB].

Zsh can do different things depending on where in a command you are:

$ git add [TAB]
Applications/  Mesh/       Projects/
Desktop/       Movies/     Public/
Documents/     Music/      Sites/
Downloads/     Parallels/  backup/
Library/       Pictures/   bin/

My point, is that, whilst all of this is very clever, the implementation is also insane.

In order to make this work, the zsh guys have had to reverse engineer every single unix command (or at least all most of the ones that I use). And any time those commands change, then zsh is going to have to change too.

It's very useful, and I'm glad that zsh has done it, and they probably didn't have much of a choice, but this way of going about things is not the Best Idea ever.

I'm sure somewhere the bash guys are working on the same feature themselves, or maybe they've already done it. I don’t care - it just strengthens the point about the lunacy of the situation.

The Unix philosophy of small programs and pipe has a lot to be said for it, but there are serious drawbacks too.

Here's some of the ways that we're innovating when it comes to the Bespin command line, and benefiting from being about to integrate things better.

GUI integration

Traditionally you've had a set of shells (bash, zsh, etc) that work in a set of terminal emulators (xterm, terminal, gnome-terminal, konsole, etc) But there's so much more you could do if you had one program do both.

In Bespin:

  • If you click on an old command, it gets copied to the prompt (the blue highlight is a mouseover).
  • If you double click it's re-executed.
  • Output is not restricted to ascii in a grid. We (predictably) use HTML.
  • Error output is visually different to normal output
  • You can minimize or maximize output (the help output has been minimized above) - I hate it when a vcs diff operation takes up 4k lines of scrollback obliterating what I wanted to see.

There's no reason why you couldn't do this in Unix (or even Windows). I don't think you’d want such a gui-shell as your login shell, but since its use is very much from within a GUI, that's OK - you’d probably launch it from the GUI anyway.

In Bespin we don't have pipes yet, but would it be neat to be able to inspect a pipeline visually as it's working, I'm sure it's possible with a gui-shell.

Linking Output to Commands

We link the output from a command to the command that created it. The obvious effect is that output from slow running commands no longer gets confused with what's happening now.

The 'slow' command is just something I hacked up to demonstrate asynchronous behavior.

A nice upshot of this is that we can implicitly add & to the end of every command, and you no longer have to wait for anything.

In essence, each command has it’s own separate stdout, which goes to it’s own div. Maybe there is a reason why unix shells don’t do something similar. Would it mean shells being curses based or something?

Command Meta-Data

With the exception of the reverse-engineering of the command line structure done by zsh, the integration between commands and the shell is limited. In Bespin, a command is a structure like this

{
    name: 'createproject',
    takes: ['projectname'],
    preview: 'create a new project',
    usage: '[newprojectname]',
    execute: function(commandLine, projectname) {
        /* code to do the work */
    }
}

This means that we can provide help as the user is typing. The idea is that TAB will guess what you want to do at all times.

This ties in a lot with GUI integration too. If the command line knows that the next parameter is a file, when the user presses TAB without typing anything to complete on, we can offer a dialog to allow selection of a file, and so on. This isn’t about forcing the user to switch to the mouse, but it is about allowing better feedback from the system about what options are available.

We've only really got started with this part - there’s a lot more work to do. I hope we'll be able to do some of the funky GUI integration that Ubiquity has been pioneering.

Attention Guides

There's a lot to look at on any command line, I want to find ways to keep the most important bits in front of your eyes at all times. I'd like to expire older commands more intelligently than a standard terminal (oldest dies first), Commands are more important if:

  • They are still in progress
  • They keep being re-executed
  • They are waiting for input
  • etc

We've only basically started on this right now, with the ability to hide/show output, but there's potential for it to make the command line lots more usable.

Plug-ins

Linking everything together is easy if you make one big monolithic lump. That's not the plan - we're evolving a plug-in strategy as we go, and planning on making as much of Bespin itself use the plug-in system. The key to coupling is to get the right level of coupling.

Status Messages

My other integration obsession is about status messages. There's a huge amount we could do to integrate the familiar concept of "what are you doing now" with commit messages, bug trackers, chat, and team tracking. More soon.

What other things could we do to trick out the command line?

Tags :


auto-completed host list

The host list comes from, I believe, a combination of /etc/hosts and ~/.ssh/known_hosts

auto-completed host list

Thanks, that would make sense.

auto-completed host list

This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.

auto-completed host list

The Bespin Command Line needed some attention for sure. How have you used it in real world apps or development? Trading Pins

bash completion

I was curious about this a while back, and I found that bash has similar functionality implemented via the bash-completion project (http://www.caliban.org/bash/). Basically, bash fills the autocomplete by passing the command line into a series of shell scripts. Third parties can add additional scripts to a directory (/opt/local/etc/bash_completion on Mac OS X dports) to enable completion for a new command. Also, yes, commands are not auto backgrounded in shells because they may need full control over the output stream to use curses-like functionality. In fact, implementing a shell such that curses features work correctly is quite difficult, and even emacs does a poor job. I have been thinking about these exact shell features in an AJAX environment for about a year now without doing anything about it. I clearly need to get involved with Bespin.

"xmlshell"

Thanks for bringing this up, as there's so much unexplored potential here! Back in the early days of Mozilla Seamonkey - 1999 or so - someone cooked up the beginnings of a Mozilla-based command shell which would execute commands on the given machine and then display the XML/HTML returned inline. It had its own versions of common commands like "ls" which - because it had the full HTML renderer at its disposal - could do things like image thumbnails in the file listing. The project was called something like "XMLShell" but Google is not returning anything useful, alas.

"xmlshell"

In order to make this work, the zsh guys have had to reverse engineer every single unix command (or at least all most of the ones that I use). And any time those commands change, then zsh is going to have to change too.It's very useful, and I'm glad that zsh has done it, and they probably didn't have much of a choice, but this way of going about things is notHow To Get Rid Of Cellulite,Get Rid Of Cellulite, the Best Idea ever.I'm sure somewhere the bash guys are working on the same feature themselves, or maybe they've already done it. I don’t care - it just strengthens the point about the lunacy of the situation. The Unix philosophy of small programs and pipe has a lot to be said for it, but there are serious drawbacks too. Here's some of the ways that we're innovating when it comes to the Bespin command line, and benefiting from being about to integrate things better.

Re: Command Lines

It was called xmlterm.

Re: Command Lines

This blog is b0rked (I only get the HTML - unless there's a 502 "Error reading from remote server" - and no CSS or images). That's a pity.

Re: Command Lines

Seems fixed - thanks!

Re: Command Lines

This makes sense.

Re: Command Lines

yeah command lines have come a long way, same for site design. before you would just use notepad, and now you have notepad++, dreamweaver etc. Makes designing things much quicker, since you don't need to bounce back and forth. i.e. I made 370Z Body Kit and 370Z Exhaust sites in a few weeks, couldn't have done it, if I had to check all the pixels by going back and forth to firefox.

Re: Command Lines

thanks for a wonderful share.:) California Loan Modification

kerja part time

I totally love this article. I think you could write some other things to make your blog more complete. kerja part time

Re: Command Lines

Sometimes I have a hard time accessing this blog but Bespin really looks promising!

fiancee visa

I'm very interested in your article, and I suggest you to browse some online stores to find something different.

healthy celebs

Great article! I’m really curious about this. I can’t wait to see what happens.

Re: Command Lines

Using CLI (on WIN at least), some INI paths are relative to the current working directory. For example, if your error_log = "php_errors.log", then php_errors.log will be created (or appended to if already exists) in whatever directory you happen to be in at the moment if you have write access there. <a rel="mustang parts" href="http://www.wheelsmustang.com">mustang parts

Re: Command Lines

Command lines usually confuse me. I always need to have a cheat sheet near me all the time!

Re: Command Lines

<a href = "http://www.homesearchfinder.com/">Real Estate | <a href = "http://www.homesearchfinder.com/ca-homes.html">Houses | 3.5% FHA | <a href = "http://www.homesearchfinder.com/featured-listings.html">Houses | <a href = "http://www.homesearchfinder.com/forum/">Mortgage | 100% VA | <a href = "http://www.homesearchfinder.com/instant-prequal-and-apply.html">Refinance | <a href = "http://www.homesearchfinder.com/lending.html">Refinance | Zero Down USDA | <a href = "http://www.homesearchfinder.com/ca-homes/la-central/238-los-angeles-ca-homes.html">Los Angeles Homes For Sale | <a href = "http://www.homesearchfinder.com/ca-homes/east-bay/221-newark-ca-homes.html">Newark Home | Half Percent Down | <a href = "http://www.homesearchfinder.com/ca-homes/inland-empire/347-riverside-ca-homes.html">Riverside Home | <a href = "http://www.homesearchfinder.com/ca-homes/long-beach/269-lakewood-ca-homes.html">Lakewood Homes | 203 K FHA | <a href = "http://www.homesearchfinder.com/ca-homes/la-west-south-bay/290-santa-monica-ca-homes.html">Santa Monica Real Estate | <a href = "http://www.homesearchfinder.com/ca-homes/long-beach/243-long-beach-ca-homes.html">Long Beach Homes For Sale | Conventional Loans | <a href = "http://www.homesearchfinder.com/ca-homes/east-bay/221-newark-ca-homes.html">Newark Realtors | <a href = "http://www.homesearchfinder.com/ca-homes/orange/339-westminster-ca-homes.html">Westminster Real Estate | Jumbo Loans | <a href = "http://www.homesearchfinder.com/ca-homes/la-west-south-bay/299-carson-ca-homes.html">Carson Homes | <a href = "http://www.homesearchfinder.com/ca-homes/long-beach/243-long-beach-ca-homes.html">Long Beach Realtors | City Down Payment | <a href = "http://www.homesearchfinder.com/ca-homes/inland-empire/348-corona-ca-homes.html">Corona Homes For Sale | <a href = "http://www.homesearchfinder.com/ca-homes/long-beach/243-long-beach-ca-homes.html">Long Beach House | 2yr BK Discharge OK | <a href = "http://www.homesearchfinder.com/ca-homes/monterey/505-monterey-ca-homes.html">Monterey Home | <a href = "http://www.homesearchfinder.com/ca-homes/inland-empire/741-inland-empire-additional-cities.html">Bloomington Homes For Sale | <620 FICO with No 12 mo lates | <a href = "http://www.homesearchfinder.com/ca-homes/monterey/506-marina-ca-homes.html">Marina Real Estate | <a href = "http://www.homesearchfinder.com/ca-homes/la-west-south-bay/264-redondo-beach-ca-homes.html">Redondo Beach Real Estate | 620+ FICO Ok | <a href = "http://www.homesearchfinder.com/ca-homes/chico-humboldt-mendocino/738-chico-humboldt-mendocino-additional-cities.html">Eureka Homes | <a href = "http://www.homesearchfinder.com/ca-homes/orange/278--santa-ana-ca-homes.html">Santa Ana Realtors | 6% Seller Credit OK | <a href = "http://www.homesearchfinder.com/ca-homes/san-diego/753-san-diego-imperial-additional-cities.html">Bonita Real Estate | <a href = "http://www.homesearchfinder.com/ca-homes/orange/339-westminster-ca-homes.html">Westminster Homes For Sale | 30 Yr Fixed | <a href = "http://www.homesearchfinder.com/ca-homes/east-bay/485-walnut-creek-ca-homes.html">Walnut Creek Homes For Sale | <a href = "http://www.homesearchfinder.com/ca-homes/la-central/744-la-central-additional-cities.html">Ladera Heights House | 15 Yr Fixed | <a href = "http://www.homesearchfinder.com/ca-homes/peninsula/388-burlingame-ca-homes.html">Burlingame Real Estate | <a href = "http://www.homesearchfinder.com/ca-homes/long-beach/281-norwalk-ca-homes-and-mortgages.html">Norwalk Realtors | 20 Yr Fixed | <a href = "http://www.homesearchfinder.com/ca-homes/san-diego/730-san-marcos-ca-homes.html">San Marcos Homes For Sale | <a href = "http://www.homesearchfinder.com/ca-homes/inland-empire/349-moreno-valley-ca-homes.html">Moreno Valley Real Estate | 5 Yr Adjustable | <a href = "http://www.homesearchfinder.com/ca-homes/san-gabriel-valley/283-west-covina-ca-homes.html">West Covina Home | <a href = "http://www.homesearchfinder.com/ca-homes/orange/304-mission-viejo-ca-homes.html">Mission Viejo Homes For Sale | 7 Yr Adjustable | <a href = "http://www.homesearchfinder.com/ca-homes/inland-empire/423-victorville-ca-homes.html">Victorville Home | <a href = "http://www.homesearchfinder.com/ca-homes/east-bay/225-brentwood-ca-homes.html">Brentwood Realtors | 10 Yr Adjustable

ann j peters md

I'm very interested in your article, and I suggest you to browse some online stores to find something different.

Re: Command Lines

The blog is too good and i like to be a member that it will help me in programing thanks for sharing the post. LEED Certification Canada

Re: Command Lines

I admire the post created by you and would look for similar posts by you which would surely help us in one or the other ways. Thanq domain amber

Re: Command Lines

This post really explains a lot about just how far command lines have gone! Its great to see that its finally integrated with GUI.

Re: Command Lines

I must say that blog is written in very informative way. Congralutaltion for author for nice design and interesting articles.

Re: Command Lines

It clearly shows that the article has made a good impact upon the users. I really appreciate a lot. Good inside details and great writings.

Re: Command Lines

Simply one of the great article that I have ever written. Very good stuff. I really enjoy it a lot. Great content with nice planning.:) buy youtube views

Re: Command Lines

I'm very interested in your article, and I suggest you to browse some online stores to find something different. nethin Cheap Hotels

Re: Command Lines

I realy like your article .The host list comes from, I believe, a combination of /etc/hosts and ~/.ssh/known_hosts

Re: Command Lines

that does make a whole lot of sense! thank you botox pittsburgh

Re: Command Lines

Those command lines are really starting to look better and better! The GUI is really looking good!

Re: Command Lines

Command lines have really come a long way. For one thing, they're easier to understand & remember. I was always confused with these things.

Re: Command Lines

Command lines are really confusing at first but they get better once you get used to it. The GUI is also coming along fine!

sewing machines for beginners

is this work with Linux o windows servers?

Re: Command Lines

The blog is too good and i like to be a member that it will help me in programing thanks for sharing the post.

Re: Command Lines

is there any more tutoriul like this...!! Used Cars for Sale

Re: Command Lines

Well, the post is actually the freshest on this valuable topic. I concur with your conclusions and will thirstily look forward to your approaching updates. Saying thanks will not just be enough, for the tremendous lucidity in your writing. I will right away grab your rss feed to stay abreast of any updates. Gratifying work and much success in your business endeavors! Life Experience College Credit Austin

Re: Command Lines

The way you've bound the output to the command occurence is sheer genius -why didn't I think of that? Play Bike Games

Re: Command Lines

Nice article on "Command Lines"...Internet Marketing Company

Re: Command Lines

There’s news and discussion about a recent flaw in Gmail that can expose your contact list to any page. Summary: If you are logged into a Google account (email, personal homepage, etc) then another site can use that authentication to access your...

Re: Command Lines

Prints contents of current directory with the full path prepended to each entry. You can add '-type f' if you don't want the directories to show up (for those less familiar with find). I can't believe ls doesn't have an option for this. Airport Parking

Re: Command Lines

Command Lines Seems to be somewhat confusing for me. But found very interesting.

Re: Command Lines

Working on command line mayn't be user friendly but when any Professional use it then he knows everything behind the screen. So for each Computer Professional should be prepare for that. Best Regards, employment news Freshers Jobs

Re: Command Lines

Command lines usually is suited for computer Professionals only but user have no idea for it so it is surely tough a user who are non-computer Professional. But for being a good computer Professional every professional should be very handy to use it.ricoh type 165 toner

Re: Command Lines

Firstly, huge thanks for such a great and useful information about the OpenGroup. I was actually looking for these information for quite a long time and i believe i have landed at the right page. I really liked your ways of expressing thoughts. You write too well. Moreover your article contains some worthy information which i guess will help lot of people. Thanks a lot one more time for publishing these nice posts and keep up publishing ones in the future too.Best regards, Tony Watson from Michigan

Re: Command Lines

Sometimes I have a hard time accessing this blog but Bespin really looks promising! internet marketing services

bankruptcy lawyer new york

I have an important question. You mentioned that you chose to ignore ring settings in this paper enigma machine. I have been trying to get the ring settings working by cutting each paper strip in half and shifting the right side by the appropriate ring offset..eg to the 2nd position if the ring is B offset. If all the examples have a GAAA and RAAA setting, I get the paper enigma to match the enigma simulators, but if I try any ring offset, the results don't match. I went to the rotor details in Wikipedia and tried to replicate their results with GAAA and RBBB to get EWTYX to no avail. Could you please help tell me how you would get this to work right if I cut your strips in half and rotate 6 different rings instead of 3?

hilarious quotes

I think this command line comes in LINUX - GNU Regards, hilarious quotes

CandyJou

What kind of music is this? I guess no solo singer here sings this. It's cool! Heathrow Airport Parking

Re: Command Lines

Hi I just wanted to leave a comment to say that I enjoy your blog. Looking at the number of comments, I see others feel the same way! Congratulations on a very popular blog. custom essays - online fashion design degree

Re: Command Lines

you are right, it did use to look like that. good ol' days...Best Article Submission

Re: Command Lines

Great job, I enjoy your blog. Looks like old fashion style : writing your dissertation in my university 6 years ago. But like this style.

Re: Command Lines

I have to say Command Lines is not for novices like me. But once I get to be a professional, I'll be looking up the update.

Re: Command Lines

Nice post on the development of some different command lines, some good stuff here. But it'll take some time to sink in. get over a relationship

bankruptcy lawyer new york

I don’t think the issue at hand is an expectation of recompense or even direct apology. The Turkish government is claiming the Armenian genocide DID NOT happen. As I noted in a previous post, general apathy toward the genocide led Hitler to believe a Jewish genocide would be met with similar indifference (”Who remembers the armenians?”). The erasure of genocide leads to a culture of impunity which fosters more genocide in the future. Sue, I invite you to read my earlier post on this for more information on the history of the cover up, which has often involved coercion.

buy youtube views

I have an important question. You mentioned that you chose to ignore ring settings in this paper enigma machine. I have been trying to get the ring settings working by cutting each paper strip in half and shifting the right side by the appropriate ring offset..eg to the 2nd position if the ring is B offset. If all the examples have a GAAA and RAAA setting, I get the paper enigma to match the enigma simulators, but if I try any ring offset, the results don't match. I went to the rotor details in Wikipedia and tried to replicate their results with GAAA and RBBB to get EWTYX to no avail. Could you please help tell me how you would get this to work right if I cut your strips in half and rotate 6 different rings instead of 3?

southern california bankruptcy attorney

A great tip from a friend of mine is to bring documentation, or examples of students' work from previous experiences to job interviews. This allows a more comprehensive vision of what you can bring to an art-making situation.

Re: Command Lines

Thanx for such an informative post and I would love to hear more from you on this topic. Programmers like me are always in search of such syntax and command line.

Re: Command Lines

Awesome read, thanks for sharing. Its a good insight on the topic. Indian Recipes Community Center

Re: Command Lines

Thanks for this Information. Nice Work.

Re: Command Lines

I have a hard time accessing this blog but Be spin really looks promising!

Best Erection Pills, Free Erection Pills, Erection Pills Re

Hey Great job.Of course, what a great site and informative posts. But I can't understand how to add your site in my rss reader. Can you Help me please? Anyhow keep up the good work. Thank you for listening http://besterectionpills.net/

Re: DWR version 3.0 Release Candidate 1

look our shop we sell cheap nfl jerseys

Re: Command Lines

A command-line interface (CLI) is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks. sofa beds

Re: Command Lines

Wedding gifts for him and her. his and hers wedding gifts and some great info about iphones iphone apps

JeremyNath

Good post. I am also going to write a blog post about civic youth. This is really amusing. eco friendly homes

Re: Command Lines

Command line is a good one to start programming. Search Engine Optimization

Re: Command Lines

This is the first time I visit this website and I like it. Already bookmarked...;-) Wohnen Sessel

Electric beds

Admiring the time and effort you put into your blog and detailed information you offer! I didn't know that! electric beds

Re: Command Lines

Plugs-in are one of the most effective tools for developing large applications. Muscle Cars

Command Lines

Where would we be without the command lines in the webdesign business.. Years ago there was few competition, nowadays with CMS everybody can create websites which gives a lot of stress and make prices go down.

Re: Command Lines

Hey Great job.Of course, what a great site and informative posts. But I can't understand how to add your site in my rss reader. HGH. Can you Help me please? Anyhow keep up the good work. Thank you for listening

Re: Command Lines

Very informative. Thanks for sharing. Hindi Movies

Re: Command Lines

Resources like the one you mentioned here will be very useful to me! I will post a link to this page on Famous Software

Add a comment Send a TrackBack