I'm running tmux 3.1b on RHEL 7.9.
The following .tmux.conf leads to an expected status line:
$ cat .tmux.conf
set -g status-left "test"
However, if I put a full-with unicode character in the status line:
$ cat .tmux.conf
set -g status-left "👥 test"
The status line seems to be rendered with inappropriate width in the presence of full-width characters, resulting in an overflow onto the next line. Every time tmux refreshes the line, it adds another new line. Anyone have an idea why this might be happening or how to tell tmux to pad the status line less? I did some digging and there are some people complaining of the wrong width for unicode characters in tmux, but I'm not confident that's the problem here.
I'm using mintty 3.4.4 fwiw.
This is probably due to a disagreement between libc, terminal and font about character width. Try building tmux with utf8proc or try a different terminal or font.
Related
I am very new to zsh. I just installed zsh and oh-my-zsh. When I run the terminal I see the following picture:
You may see that in zsh the line starts with space followed by a username. To compare in bash the line starts with username immediately.
How can I remove this first space in zsh? (I can't find this config setting in docs)
Why the split line of tmux within PuTTY shows different(xxxxx, qqqqqq)in these tow cases?
If I do not set PuTTY any thing(the default "Use font encoding"), the split line of pane shows like following:
But it can't show Chinese word correctly, so I set PuTTY's Window -> Translation -> Remote character set to UTF-8. Then the split line of pane become to like that:
Using “xxx qqqq” seems very ugly.
BTW: echo $LANG shows “zh_CN.UTF-8”
So, in this case, How to show Chinese word correctly with the first split line?
I had the same problem with Putty with character set set to UTF-8.
Launching tmux with -u option did the trick (tmux -u)
I was having the same issue except I was not trying to display Chinese characters. For the ugly line break ( xxxx qqqq), take a look at Tmux borders displayed as x q instead of lines?. For me, there are two version of tmux installed and switching to the newer version solves the problem. You may want to upgrade your tmux. Hope it helps.
I'm new to Vim. I was experimenting with vim-powerline and tmux (and pathogen and vundle).
Somwehere in that process I tried to remove powerline and tmux started receiving this error.
My .tmux.conf file is empty. How can I find where tmux is trying to run this command?
I had this problem, too, but not in the first tmux window. It only happened for me in subsequent windows. I found a solution, but not exactly the cause of the problem.
The short version is the set the value of the POWERLINE_COMMAND variable in your .bashrc on the line before you source the bash binding. For me, that means:
export POWERLINE_COMMAND="$HOME/powerline/scripts/powerline"
. $HOME/powerline/powerline/bindings/bash/powerline.sh
I don't get exactly why this happens in subsequent tmux windows but I added some echo lines to the bash binding to find out what's happening. When the binding is sourced in subsequent windows, POWERLINE_COMMAND is already set to powerline, so it skips the code that checks for the right place to set it. I couldn't figure out where, how, or why it's already set, though.
Here's the code that does the check from the beginning of the bash binding:
if test -z "${POWERLINE_COMMAND}" ; then
if which powerline-client &>/dev/null ; then
export POWERLINE_COMMAND=powerline-client
elif which powerline &>/dev/null ; then
export POWERLINE_COMMAND=powerline
else
# `$0` is set to `-bash` when using SSH so that won't work
export POWERLINE_COMMAND="$(dirname "$BASH_SOURCE")/../../../scripts/powerline"
fi
fi
Since it works in the first window, I just set POWERLINE_COMMAND to point to the command that it points at in the first window. Setting it before sourcing the bash binding skips the whole check.
I suggest you to check your shell's configuration files. If you use e.g. use bash, check $HOME/.{bashrc,profile} or $HOME/.zshrc for zsh. There is probably a line like
. {repository_root}/powerline/bindings/bash/powerline.sh
according to the powerline installation instructions.
I posted an issue found at on the github link below, but in short, I can't get zsh to work properly. I'm open to suggestions.
https://github.com/erikw/tmux-powerline/issues/125
Do you have UTF characters in your prompt? If so, make sure you have these settings in your .tmux.conf:
# use UTF8
set -g utf8
set-window-option -g utf8 on
Some UTF characters will take an extra space, causing some weird formatting of tmux-powerline.
When I search in, for example, man ls while in a tmux session, the search strings don't appear highlighted - the page jumps down so that the search string is on the top line of the buffer, as expected, but it's not highlighted.
Doing the same thing in the same shell while not in a tmux session results in highlighted search strings.
I have no idea where to start looking to solve this. Any hints are appreciated.
Based on Less Colors For Man Pages by Gen2ly, here is my man page and how to do it:
Preview
This is a shell, not a web page !
How to
(optional) I'm using Tomorrow theme for Konsole/Yakuake ;
Edit your ~/.bashrc ~/.zshrc, etc. to add :
# Colored man pages: http://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/
# Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;016m\E[48;5;220m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
Reload your config and try a man page search :
. ~/.bashrc && man ls
Fixed it. The problem is to do with the way that the screen $TERM handles italics. From the tmux FAQ:
vim displays reverse video instead of italics, while less displays italics
(or just regular text) instead of reverse. What's wrong?
This matches my problem exactly. The $PAGER used by man is less by default - basically, man uses less to show the contents of the manual pages. In my case, less wasn't highlighting text, just showing regular text.
The reason for this happening:
Screen's terminfo description lacks italics mode and has standout mode in its
place, but using the same escape sequence that urxvt uses for italics. This
means applications (like vim) looking for italics will not find it and might
turn to reverse in its place, while applications (like less) asking for
standout will end up with italics instead of reverse.
The solution is to make a new terminfo file for tmux, which lets it know that italics are supported. The solution's outlined in the (at time of writing) very, very bottom of the tmux FAQ.
After creating the new terminfo file, in tmux: C-b :source-file /absolute/path/to/.tmux.conf (from this SuperUser question) - this should make tmux reload the .tmux.conf file. However, this didn't work for me, and the changes only applied after restarting the tmux server (close all tmux sessions, then re-open them).
This thread is a few years old but is still the one that comes up as the best search result, so I'm answering with what finally worked for me. This is based off of tmux FAQ.
...but the instructions aren't completely clear on when or where to substitute the -256color string. I use gnome-terminal (v 3.16.2) with tmux, and this worked for me:
$ mkdir $HOME/.terminfo/
$ screen_terminfo="screen-256color"
$ infocmp "$screen_terminfo" | sed \
-e 's/^screen[^|]*|[^,]*,/screen-256color|screen with italics support,/' \
-e 's/%?%p1%t;3%/%?%p1%t;7%/' \
-e 's/smso=[^,]*,/smso=\\E[7m,/' \
-e 's/rmso=[^,]*,/rmso=\\E[27m,/' \
-e '$s/$/ sitm=\\E[3m, ritm=\\E[23m,/' > /tmp/screen.terminfo
$ tic /tmp/screen.terminfo
And tell tmux to use it in ~/.tmux.conf:
set -g default-terminal "screen-256color"
Note: I tried it once without the -256color and since that didn't work (still seeing italics instead of highlighting), I had to delete everything under the .terminfo dir (another dir called 's') before the infocmp would work.