Zsh and Its Searchable History

So I guess this says a lot about me and the limited things I do on my Linux box as well as the power of ZSH’s searchable history, but I find myself rarely typing commands from scratch. Instead typing the first few letters of the command then using the up cursor arrow to search for the last time I ran that command. It is so, so useful. Rarely do I need to grep my way through my .history file. For commands such a checking a Duplicity backup to Backblaze’s B2 buckets, where I need long strings of my keys it is essential. But for even simple commands like updating my Gentoo setup it is just so useful.

Can you remember this every time?
Duplicity collection-status b2:// [22 character string]:[22 character string]@BucketName/folder

I should remember this one, but I never remember those parameters…

Emerge -uDNav @world —keep going

For bash that was:
history | grep xxxx
– Then typing the line number.
– Hitting ctrl-c to kill that command
– up cursor key then editing the command before hitting return.

With ZSH I type the first few characters and then the cursor. Even when you search and use the line number it allows you to edit that command before running it.

By default this behaviour is not enabled. But edit your .zshrc/.zprofile files and bind the UP/DOWN cursor keys to these two options:
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward

Oh and if you use zsh (it’s the default shell on macOS nowadays) then you really should use Oh My Zsh

The Shit Show

Craig Hockenberry’s blog post about the last day of Twitteriffic working is acerbic and brilliant. It’s all because of Space Karen’s blocking of most popular third party Twitter clients from their API. I never used Twitteriffic. I used the web client, then Tweetdeck and finally settling on Tapbots set of iOS/macOS clients (which have also stopped working).
Since the buyout I’ve more or less stopped using my personal account. I’m reluctant to delete it as it’s been active since 2006, but it’s not been much fun over the past few years. I have kept three other accounts active. My work account, a campaign account and a village news account. I should let these die too really.
I opened a Mastodon account when Space Karen first hinted he wanted to buy Twitter (thanks Raj!) but never really used it. But since November I have. A much pleasanter place.
So far I’ve been using an iOS Mastodon app, Metatext, on iOS and macOS (Apple Silicon right!). Luckily Tapbots are working on an iOS Mastodon client, that I managed to get on the latest round of TestFlight beta apps yesterday.
Note: I’m posting this in an attempt to revive my blog. Instead of Marsedit (my usual blogging tool) I’m using Drafts with the WordPress Action.