I have 7 dashes (-------) on the lower right.
Can I replace them with something like my name or my host name?

This is not about the PS1 prompt. I already have time name host dir there.
I use tmux.
I am on Ubuntu13 but I'd like it to work in iterm2 on OSX if possible.

In .tmux.conf I have it as

set -g status-right "-------"

How can I make it be user or host? I tried \u but that didn't work.


enter image description here<--- here

  • 2
    Post your tmux.conf: that is normally the area defined by status-right... – jasonwryan Apr 19 '14 at 20:47
  • On second thoughts, this does look like it is about your (possibly broken) PS1. Is that dotted line supposed to be above every prompt? – jasonwryan Apr 19 '14 at 20:55
  • +1, nope you got it the first time, it's my .tmux.conf file setting for status-right. Updating the question with the new info. – Michael Durrant Apr 19 '14 at 21:06

The FORMATS section of man tmux has a complete list of the values that you can use in your status line.

As well as these, you can pipe the output of shell commands, making it possible to include any information that is accessible from your shell in the status line.

Your hostname, for example, can be printed with #H, or #h for the short name (without the domain name).

To include your name (and not hardcode it), you could print the truncated output of who: which would be something like #(who | cut -d \" \" -f1). Note that you need to escape the quotation marks...

I have a more comprehensive answer to this question on StackOverflow..

  • 3
    or just use 'whoami' – dmd Mar 16 '16 at 14:56

To set hostname to right part of tmux statusbar:

set -g status-right "#H"

You can find more commands in this tmux cheatsheet under "Customizing tmux" section: http://www.cheatography.com/bechtold/cheat-sheets/tmux-the-terminal-multiplexer/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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