Erik Zaadi

The tales of a developer with passion for dad jokes

TMUX for multilangual cli addicts

As you might know, TMUX is awesome.

ALAS

There is nothing more frustrating than when you’re muscle memory fails you.

You’re entering the correct key sequence, and your tmux is simply ignoring you.

You enter a state of CLI ROAD RAGE.

You curse the old gods of QWERTY, check your keyboard battery level (/hipster), gurgle quotes such as:

That wouldn’t happen in linux

Only to discover a couple of minutes later that your input language was in Swedish.

Now TMUX may be smart

But there’s no way in hell that tmux will recognize your MÖDIFIER instead of MODIFIER.

Applescript to the rescue

StackOverflow brought me a lovely snippet in Applescript that get’s the current language.

I saved that with an Applescript shebang (#!/usr/bin/env osascript) as an executable in my path called apple-language. See here for reference.

But showing the current languange in TMUX as an indicator is lame, let’s do it with emoji!!1

Enter apple-languange-to-emoji!!1

Ok now I have the current language flag emoji, now for making that visible in TMUX, I simple add #(apple-language-to-emoji) in my status bar.

Here’s the entire change.

Unt Voila!

Share on: