Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i am running tmux from a tty on an embedded linux device. (NOT a terminal emulator) because the screen is rather small, i want to add some "icons" to the tmux status bar. to achieve this, i have simply created a font with the appropriate glyphs for things like battery, or wifi. i can load the font, and display the characters with calls that use an escape to the line drawing characters like so:

echo -e "\xe\234\xf"

\xe escapes me into line drawing character mode, \234 is my created character, and \xf returns me to normal character mode so my terminal doesnt start getting goofy.

this works perfectly if i enter the command at the terminal whether tmux is started or not. the issue arises if i then try to use it in my ~/.tmux.conf file for the status bar. i currently have a line like this:

set -g status-right "#(echo -e "\xe\234\xf") #(/script/to/output/powerlevel)

this simply outputs

xe234xf powerlevel

this goes the same if i try printf over echo. this is the output i would expect to get on the terminal if i made the call without passing -e to echo, or without enclosing the statement with quotes.

i then decided to wrap the calls to the echo or printf in a shell script. again, the script works when called from the terminal, but not in tmux's status bar. now i get the unprintable character "�" instead of my icon, like this:

� powerlevel

this is what i would expect if i did not use the line drawing escapes previously mentioned above, or if i tried to copy and paste the character as text using tmux. in addition, the calling of these character scripts screws up the rest of my status-right, as the clock has about 6 digits for minutes when it is called (though it correctly only updates two of them).

how can i make tmux respect the escape characters?

any help or insight is greatly appreciated.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Ok, I found a workaround finally. rather than escaping to the alternate character set. i found that these characters also simply have a hex value associated with them. if i printf or echo -e that hex value then tmux will display the correct character.

the issue remains however that tmux will only show the correct character if i wrap those calls in a shell script, as it still does not follow any of the escapes (like \x for hex). If anyone could shed any light or add insight to this i would still really appreciate it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.