Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emoji display issue in vim with tmux

The Problem

Emojis display incorrectly in vim only inside tmux, and only in vim inside tmux. Emojis work as expected in vim outside of tmux. Emojis work as expected in other programs inside of tmux.

Inside TMUX:

vim ~/echoemoji.sh

vim inside tmux

sh ./echoemoji.sh

shell inside tmux

nano ./echoemoji.sh

nano inside tmux

OUTSIDE TMUX:

vim ./echoemoji.sh

shell outside tmux

Relevant Configs

vimrc

set encoding=utf-8
set t_Co=256
set termencoding=utf-8

:set term
  term=xterm-256color

tmux.conf

  set -g default-terminal "xterm-256color"

iterm2

Character Encoding: UTF-8
Report Terminal Type: xterm-256color
Font: Hack
Non-ASCII Font:  Inconsolata-dz for Powerline
Use HFS+ Unicode normalization (checked)

zshrc

alias tmux="tmux -u" # Tried with and without
like image 411
jbo Avatar asked Mar 30 '17 02:03

jbo


1 Answers

this is an issue with how iterm's default unicode version is 8, and nvim's default version is 9. Switching away from emoji characters on the gutter fixes the issue. (iTerm 3.1 will have more configurable emoji versions)

https://www.reddit.com/r/vim/comments/6vkoii/vim_text_rendering_off_by_one_issue/

enter image description here

Select Iterm2->Profiles->Text->Use Unicode versoin 9 widths

like image 180
Pegasus Avatar answered Sep 19 '22 23:09

Pegasus