The fish shell

April 7, 2016

Continuing in the vein of my previous posts about changes I’m making to my development setup, this week I have been looking at shells. Somewhere once upon a time I encountered the idea that cool kids don’t use bash, and the commonly-cited alternatives are zsh and fish. A thread on Reddit pointed out a few of the compelling advantages of zsh over bash, and Ars Technica has a fairly old article detailing some of the ideas behind fish.

Some people complain about fish’s not supporting !! and related syntax like !$, but I’ve always found the expansion of ! problematic (when e.g. writing commit messages) and I prefer to just use interactive editing of commands from my history, or Alt-. to retrieve the last word in a previous command. (fish supports both quite well.)

Some features that I really like about fish so far are:

  • Tab completion. I think I must have tried zsh once a long time ago because I have some sort of vestigal memory of trying to tab-complete some filename and hating it. Specifically, I remember hitting Tab a few times (which is deeply ingrained in my muscle memory from years of using bash), and zsh immediately inserting something into my command line, with my only option to keep pressing Tab until I got to what I wanted. (I believe this is called menu completion in the literature.) I felt this was too aggressive; if I wanted to refine the filename a bit, or if I saw that I had entered the wrong directory, I had to erase what the shell had just injected. fish’s tab completion is like all the best parts of this mechanism, but better. It isn’t adequately covered in the documentation, but this Stack Overflow post does a good job detailing its behavior. Basically, you can cancel the tab completion using Escape, and you can refine the search by typing stuff even once you are in "menu" mode, sort of like an ido/swiper sort of thing. Very slick.
  • If a command prints some output that doesn’t end in a newline before you get to a prompt, fish puts out a cute symbol and inserts a newline. Your prompt always starts on a new line, but you get a clear indication that what you see isn’t exactly what you got.
  • Ctrl-K and Ctrl-Y on the fish command line interoperate seamlessly with my windowing system’s clipboard.
  • I’ve never been super into pushd/popd, but fish has prevd and nextd which seem pretty nice.

Lots of people online recommend oh-my-zsh or zprezto, but it mostly seems like the things zsh offers (even with these packages) aren’t incredibly amazing. Maybe there’s some draw for die-hards, but there’s a lot of overhead involved in learning these packages, setting them up, and maintaining them. By comparison, fish has hardly any configuration available at all, so hopefully you like how it works, because if you don’t, you can’t change it.

In general, the dichotomy between zsh and fish is between the incredibly flexible Swiss-Army-knife all-singing-all-dancing tool with a gazillion options, and the beautifully crafted tool with only one, extremely-carefully-thought out option. zsh is KDE and fish is GNOME. Or, zsh is Perl, and fish is Python. I’m sure you can come up with some other analogies.

I’m still getting my prompt and favorite functions set up, but a few commands I’ve found useful:

  • type [commandname] lets you see what kind of command something is, and if it’s a shell function, see its definition. Apparently this is common to even bash, but I had never used it before.
  • vared lets you interactively edit a variable. zsh has this too; fish also has funced for editing functions.

A couple things I’m annoyed about:

  • The fish web page compares fish’s autocomplete behavior to a browser’s, but there’s no way to tell fish to not record history for a shell session, analogous to a browser’s "private browsing" mode.
  • In both fish and zsh, array indices start at 1, not 0 as you might be used to.
  • fish’s readline doesn’t support Control-_ for undo, and maybe doesn’t support undo at all.
Comments Off

Bloggers now eligible for press passes in NYC

March 19, 2013

I made a note to myself to write about this article on Slashdot about bloggers being given press passes, an interesting note in the story of the evolution of journalism. Of course, now it’s three years later. I’m not even sure I’ve ever heard of anyone getting one of these passes, but then, I don’t hang out in bloggers’ circles.

Comments Off

India’s Zero Rupee Note

March 19, 2013

I don’t remember exactly where I first heard about this, but it came up from a number of different sources, which was itself interesting. India ‘issues’ zero rupee banknotes. Wikipedia’s article. Another article.

He gave one example where a tax official refused to process documents unless he paid her 500 rupees.

"I handed over the zero-rupee note which I always keep in my pocket," said Sundar.

"She was afraid and didn’t want to take it. She completed the job immediately and said she was sorry and asked me not to take it forward."

We sure could have used something like this in Cameroon..

Comments Off

Superstruct

August 30, 2010

Saw this image while reading about Punk Rock Mathematics:

http://travelogue.betacantrips.com/wp-content/uploads/2010/08/wpid-superstruct_threats.png

Apparently this was part of a project called Superstruct, which is apparently now quite defunct, but at the time was some kind of experimental game, aiming to (as far as I can tell) brainstorm solutions to the world’s problems in some form of social networking/alternate reality schema.

Q: How do I play Superstruct?

A: Superstruct is played on forums, blogs, videos, wikis, and other familiar online spaces. We show you the world as it might look in 2019. You show us what it’s like to live there. Bring what you know and who you know, and we’ll all figure out how to make 2019 a world we want to live in.

It’s really interesting to look at some of the entrails of this particular beast. They put up a wikia, with a page called Superstruct Powers, which begins:

Note: By necessity this page will start out with crackpot theories, wrong ideas, and untested hypotheses. The goal is to identify the difference between theories that should be tested, and case studies of actual superstructing that can be evaluated. It’s fine to theorize, but try to protovate your theories as much as possible. Remember your scientific method: 1) Observe, 2) Make a hypothesis, 3) Make a prediction, 4) Test, and back to 1) Observe.

I personally love this kind of future-dialect that assumes you know more than you can know. Also interesting are the Plot Updates, which reflect the above image:

Under pressure from its largest client, Google, the leaders of the energy haven of SeaStar, which offers a combination of abundant clean energy (from wave, wind, and solar power), year-round aquaculture, and high-bandwidth connections to the global Internet, voted today to end efforts to declare SeaStar an autonomous national entity, accepting instead a status of protectorate of the United Kingdom.

The wiki has another page called Screaming 3D Bootstrappers, apparently an in-game clan.

All of this makes for utterly wonderful flavor text — but it isn’t clear what the game mechanics, if any, are. Sure, we can brainstorm solutions. But to see which solutions are the easiest to implement, or the most effective, or the most cost-effective? There’s a video, but right now my bandwidth is not sufficient to watch it. Anyone want to clue me in?

Also, be aware that there’s a "sequel", called Evoke, which is a little easier to grok.

The goal of the social network game is to help empower young people all over the world, and especially young people in Africa, to come up with creative solutions to our most urgent social problems….Players who successfully complete ten game challenges in ten weeks will be able to claim their honors: Certified World Bank Institute Social Innovator – Class of 2010.

The missions (here’s one) tend to encourage exploration of problems and a focus on "innovation".

Your objective: Describe the biggest challenge to food security in your own local community or country — and an innovative solution that is already underway.
Document your local insight with a blog post, video, or photo.
Your objective: Take action to increase someone’s food security near you.
Document your effort with a blog post, video, or photo.

But it’s hard for me to feel like this would be 1. fun (since it feels like a junior-high-school homework assignment) or 2. impactful (since solutions and ingenuity do not seem to be in short supply in the world). Nevertheless, it’s better than underage drinking.

Comments Off

WTFJS

March 2, 2010

OK, this is completely wonderful — exactly a thing I would have wanted to make, except somebody else made it for me, better. Keep this in mind in case anyone ever tells you the old yarn about how JavaScript is only a terrible language because of browser inconsistencies..

An example:

// be careful with those implicit .toString() calls in == comparison

typeof "abc" == "string" // true
typeof String("abc") == "string" // true
String("abc") == "abc" // true -- same types get casted to equal each other

String("abc") instanceof String // false -- hmmm...
(new String("abc")) instanceof String // true
String("abc") == (new String("abc")) // true -- wait, wtf?
Comments Off

Imagine Not

March 2, 2010

Seen on Tor.com: an interesting article about a Tim Burton exhibit.

When I went to the Tim Burton exhibit at the MoMA in NYC a couple of weeks ago, it was understandably mobbed. We visitors rotated along the walls in a tightly-packed horde, gaping and pointing. For the most part, we were reverently quiet enough so that it was startling when the fubsy guard next to the Edward Scissorhands mannequin yelled out to somebody to put a camera away. It was unbelievably cool to be that close to the nuts and bolts of someone’s imagination, especially one so wild and playful and sinister.

I was happy to plant myself with my nose a few inches from a drawing and let the people bump past me in slow-mo. I liked to take in the gist, then see how Burton used the color to fill in the lines, and most of all, I liked to see the eraser marks from where he’d changed his mind. I felt like a genius myself because I could spot, right there: that’s where Tim Burton revised. I wanted to show my niece, so I looked up to find her and saw instead these dozens of packed people.

That’s when something strange hit me. We were all there, en masse, to appreciate a mind remarkable for its singular imagination. Furthermore, we could never have as much fun looking at Burton’s stuff as he must have had making it in the first place. Something was wrong.

There are a lot of interesting memes present here that I think bear mentioning:

  • The idea that we’ve seceded our entertainment, and, by extension, our imagination, to Big Media: "During our seduction, we’ve conversely learned to imagine not. Most ironic of all, we pay Disney to tell us and our children to dream — as if we couldn’t dream on our own. That’s just dangerous." In the large, this meme is what drives the transformation from a society of consumers to a society of bloggers, youtubers, etc. The idea that we could entertain ourselves, or that creation could be fun, even if done badly, is having a significant impact on entertainment, and it will continue to be interesting to see how this impacts creators and creative industries.

    A friend of mine points out that there’s a related, perhaps opposite meme, that everyone in our generation feels they have a right to earn a living as an artist, doing whatever they want to do. Maybe we can’t all spend our time sitting around and imagining — but then, why should we pay other people to do it for us?

  • The idea that we, the mob, tend to pay homage to the "wild" and "singular": like Randall Monroe says about Monty Python, "Does anyone else find it funny that decades later, people are still quoting — word for word — a group loved for their mastery of shock, the unexpected, and defiance of convention?" Nobody quotes Tim Burton, as far as I know, but I can’t help but feel it’s a little similar.

  • The idea that we are "so accustomed to having expert versions of everything, from the perfect music on our ipods to the precision landings of our Olympic figure skaters, that we’ve lost the entire middle tier of amateur" — no matter your field, there seems to always be someone better than you at it. Indeed, I’ve also seen a similar complaint about the Olympics: that it becomes impossible to appreciate the gradations between one version of "perfect" from another. There are so many talented people — so why bother becoming good at anything at all?

Comments Off

Openhatch, the open source involvement engine

February 27, 2010

One of the neat things I saw at PyCon was a project called OpenHatch, which (among other features) indexes bugs and makes them easy to find according to your skillset and experience level. For example, lots of projects tag bugs as "easy" or "beginner" to promote newbie involvement and ramp-up; openhatch makes it easy to get involved with a project you can contribute to.

I think there’s still some work to be done — bugs about "you need a better logo" or "help, our docs are crap" don’t quite fit into this workflow. Still, good effort.

Comments Off

iPad is a “Huge Step Backward”

February 7, 2010

I was browsing this thread on Slashdot and came across a really interesting meme:

I bought an iPhone this year. This is one asset that is so important that I just want it to WORK. I don’t want to worry about viruses, or ongoing maintenance. This is my ONLY TELEPHONE LINE, and so I finally do approve of somebody keeping it locked down and pristine.

inviolet


The lockdown here is on two devices. You want a laptop or desktop you can do whatever you want with? There’s the macbook, imac and mac pro for that. Want an expandable handheld appliance with a limited (albeit ever-expanding) functionality that’ll have no hidden surprises? There’s your iPad and iPhone.

You may as well criticise arcade machine makers for vetting all the roms you can put in their hardware. Or any of the console makers for vetting what’s available for theirs. Or that kindle can’t do anything but display books. Experience has shown them all, time and time again that as soon as you open up a platform to anyone and everyone, quality and reliability take a hit, not to mention susceptibility to attack. It’s a specific product for a specific market and like the iPhone, will be hated by geeks everywhere, but loved by everyone else who want something that just works. Apple will likely do little to stop people jailbreaking these things, they’ll just make it difficult enough that only determined people do it.

CrazyBusError (emphasis mine)


First, the FSF needs to convince us average users need to have control. Why should average users have control over their computer? Isn’t this what got us the virus nightmare in Windows?

Azureflare

The idea that most people don’t want control over their computers, and that having them be locked down offers tangible benefits, is new to me. In particular, a locked down device obviates the need to perform "good houskeeping" sorts of system maintenance. Some commentators respond that you can have a good design that eliminates housekeeping without control, but by definition if a user has the potential to do whatever they want with a device, it’s just a matter of social engineering to turn their computer into a spambot.

Comments Off

Joey Hess: started termcasting

February 4, 2010

Seen on Planet Debian: Apparently there’s a thing called termcasting, and some people are doing it.

I’ve hooked one of my laptop’s terminals up to the net, so anyone with IPv6 can telnet in and see it.

I’ve long wanted to be able to broadcast my terminal sessions on occasions when it makes sense. Like when I’m fixing someone’s bug, or closely collaborating with someone distant.

Comments Off

Smartphones receive holy blessing

January 25, 2010

Seen via Slashdot: blessed be the mobile users and those called the children of iPod.

Plow Monday is normally for blessing laborers and their tools; as the name suggests it is aimed at those who work the land. A church service in London, England Monday decided to go after a more modern audience: office workers and their modern communication gadgets. From the Times article: ‘The congregation at St Lawrence Jewry in the City of London raised their mobiles and iPods above their heads and Canon Parrott raised his voice to the heavens to address the Lord God of all Creation. "May our tongues be gentle, our e-mails be simple and our websites be accessible," he said.’"

A fascinating event in the future of religion..

Comments Off