I have the following line in my .zshrc:

export PROMPT="%n@%K{9}%m%k:%~# "

It works if I connect directly

enter image description here

But doesn't work inside tmux

enter image description here

How to fix?

  • Is your tmux configured to start zsh as a login shell, or as a non-login shell? That affects whether it sources .zshrc or .zprofile I think? Mar 6 at 22:20
  • 1
    TERM=tmux tput colors indicates that that terminal emulator only supports 8 colours on my system. I have tmux-256color terminfo entry so maybe tmux can be configured to support 256 colours (assuming its host terminal(s) can too) and then you'd need to make sure $TERM is set to that value if tmux doesn't do it already. Mar 7 at 6:17
  • How to do this, don't understand?
    – Dims
    Mar 14 at 19:34

1 Answer 1


Addition of

set-option -g default-terminal "tmux-256color"

to ~/.tmux.conf helped.

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.