Glam Prestige Journal

Bright entertainment trends with youth appeal.

I am using oh-my-zsh shell and powerlevel10k theme on my system. I recently installed tmux. But for some reason the prompt of tmux is not getting correctly formatted.

Here is my .tmux.conf file:

set -g default-terminal "xterm-256color"
bind-key -r Space next-layout
set -g status-bg black
set -g status-fg white
set -g mouse on

prompt in tmux: [in tmux]

enter image description here

prompt outside tmux in normal shell: [outside tmux]

enter image description here

It will be great, if anyone can help.

1 Answer

tmux replaces non-ascii symbols with _ if it was started without -u option and the locale at the time of its start wasn't UTF-8. The best way to fix this issue is to install and enable an UTF-8 locale on your system. Alternatively, you can start tmux with -u option.

There is an additional problem in your tmux config. From man tmux:

default-terminal terminal

Set the default terminal for new windows created in this session - the default value of the TERM environment variable. For tmux to work correctly, this must be set to ‘screen’, ‘tmux’ or a derivative of them.

In your config default-terminal is set to xterm-256color. This is neither screen, nor tmux, nor a derivative of them. Hence tmux won't work correctly.

To fix this issue, replace xterm-256color in ~/.tmux.conf with screen-256color and reboot your machine. You can force tmux to reload without rebooting but rebooting will definitely do it.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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