romkatv / powerlevel10k

A Zsh theme
MIT License
45.93k stars 2.17k forks source link

In Ubuntu's tmux, the cursor cannot be displayed normally #400

Closed life404 closed 4 years ago

life404 commented 4 years ago

In macOS, the Powerlevel10k looks perform well, and can displayed normally tmux. However, after I copy my config to Ubuntu, the cursor cannot be displayed normally in tmux.

In Mac iTerm2 In Mac tmux(tmux =3.0a) In Ubuntu 16.04.5, The cursor display was also normal. However, when I open the tmux, the cursor had some problem

my config as follow

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/home/insilicon/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
export TERM="xterm-256color"

## Set powerline
. /home/insilicon/.local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
## Set POWERLEVEL9K
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status os_icon load ram dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_SHOW_CHANGESET=true
POWERLEVEL9K_CHANGESET_HASH_LENGTH=6
POWERLEVEL9K_PROMPT_ON_NEWLINE=false
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

## show Godziila
alias neofetch='neofetch --config /home/insilicon/.config/neofetch/config_custome.conf'
alias aria2c10='aria2c -x 10 -s 10'

## Set ulimit -s unlimited
ulimit -s unlimited

## Set perl
export LC_ALL=C

## Set showing of Chinese
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

PATH="/home/insilicon/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/insilicon/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/insilicon/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/insilicon/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/insilicon/perl5"; export PERL_MM_OPT;

# Set LIBRARY path
export LD_LIBRARY_PATH=/tools/boost_1_70_0_build/lib:$LD_LIBRARY_PATH
export PERL5LIB=/tools/signalp-4.1/lib:$PERL5LIB

# Set SignalP 4
export PATH=/tools/signalp-4.1/bin:$PATH
## Set trinty envirment
export PATH=/tools/samtools/bin:$PATH
export PATH=/tools/bowtie2-2.3.4.3-linux-x86_64:$PATH
export PATH=/tools/jellyfish-build/bin:$PATH
export PATH=/tools/salmon-0.12.0_linux_x86_64/bin:$PATH
export PATH=$PATH:/tools/mirdeep2-0.1.1/bin
export PERL5LIB=$PERL5LIB:/tools/mirdeep2-0.1.1/lib/perl5
### Set trinity dependencies
export PATH=/tools/RSEM-build/usr/local/bin:$PATH
export PATH=/tools/salmon-0.12.0_linux_x86_64/bin:$PATH

## Set miRDeep2
export PATH=/tools/mirdeep2-0.1.1/essentials/ViennaRNA-build/bin:$PATH
export PATH=/tools/mirdeep2-0.1.1/src:$PATH
export PATH=/tools/mirdeep2-0.1.1/essentials/bowtie-1.1.1:$PATH
export PATH=/tools/mirdeep2-0.1.1/essentials/randfold_build:$PATH

## Set transrate dependencies
export PATH=/tools/salmon-0.12.0_linux_x86_64/bin:$PATH

## Set rnaQUAST dependencies
export PATH=/tools/gmap-gsnap.build/bin:$PATH

## Set BUSCO dependencies
### Set Augustus
export AUGUSTUS_CONFIG_PATH=/tools/augustus-3.3.2/config
export PATH=/tools/augustus-3.3.2/bin:$PATH
export PATH=/tools/augustus-3.3.2/scripts:$PATH
### Set Hmmer
export PATH=/tools/hmmer-build/bin:$PATH

## Set STAR
export PATH=/tools/STAR-2.7.0e/bin/Linux_x86_64:$PATH

## Set aspera
export PATH=/home/insilicon/.aspera/connect/bin:$PATH

## Building SNAP && Set the path of Zoe
export ZOE=/tools/SNAP/Zoe

## Building BLAT
export MACHTYP=x86_64

## Set PASA pipeline
export PASAHOME=/tools/PASApipeline-v2.3.3
export PATH=/tools/gmap-gsnap-build/bin:$PATH
export PATH=/tools/blat-insilicon:$PATH
export PATH=/tools/fasta-36.3.8g/bin:$PATH

## Set MAKER dependencies
### The path of RepeatMasker
export PATH=/tools/RepeatMasker:$PATH
### The path of SNAP
export PATH=/tools/SNAP:$PATH
### The path of Exonerate
export PATH=/tools/exonerate-2.2.0-x86_64/bin:$PATH
### The path of blast
export PATH=/tools/ncbi-blast-2.8.1+/bin:$PATH
### The path of Augustus
export PATH=/tools/Augustus-3.3.2/bin:$PATH
### The path of GeneMark-ES
export PATH=/tools/gm_et_linux_64/gmes_petap:$PATH

## Set path of Evidential Gene
### Set path of exonrate
export PATH=/tools/exonerate-2.2.0-x86_64/bin:$PATH
### Set path of cd-hit
export PATH=/tools/cd-hit-v4.6.8-2017-1208:$PATH

## Set path of tmhmm
export PATH=/tools/tmhmm-2.0c/bin:$PATH

## Set path of bedops
export PATH=/tools/bedops:$PATH

## Set OrthoMCL-pipeline
export PATH=/tools/orthomcl/orthomclSoftware-v2.0.9/bin:$PATH
export PATH=/tools/blast-2.2.26/bin:$PATH
export PATH=/tools/orthomcl/mcl.build/bin:$PATH

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/insilicon/tools/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/insilicon/tools/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/insilicon/tools/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/insilicon/tools/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

#export http_proxy="localhost:8118"
#export https_proxy="localhost:8118"
#export ftp_proxy="localhost:8118"

However, I found a intersting thing, when I exit VIM, the cursor in the previous line will display normally, but there is still a problem with the current line.

romkatv commented 4 years ago

Have you followed https://github.com/romkatv/powerlevel10k/blob/master/README.md#why-is-my-cursor-in-the-wrong-place? What are the results?

life404 commented 4 years ago

The echo '\u276F' looks normal. Then, I add unset ZLE_RPROMPT_INDENT at the bottom of ~/.zshrc, still have problem. The diagnose command give the following results. Then, I input the command print -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT}, but the terminal throw the error zsh: error in flags,I don't know what it means of error in flags

life404 commented 4 years ago

And I found the theme display normally in screen, so, I suspect it will be a configuration problem with tmux.

romkatv commented 4 years ago

Then, I input the command print -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT}, but the terminal throw the error zsh: error in flags,I don't know what it means of error in flags

This likely means you are using a very old version of zsh. Type echo $ZSH_VERSION to confirm.

It's a very good idea to use a newer version.

life404 commented 4 years ago

I update my zsh from 5.1.1 to 5.7.1, and input the command print -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT} again. I can't understand the output, and can't find %{...%} or backslash escapes.

romkatv commented 4 years ago

The error is gone. This is good.

I didn't think the issues with cursor positioning were caused by the old zsh version. Sorry for the confusion. I suggested to upgrade because it's a good idea in general.

Since the standard diagnostic procedure hasn't helped, your issue isn't the same as any of the previous users had. At this point you have much more information than I to debug this. I would suggest commenting out parts of your ~/.zshrc one by one to see when the problem goes away. The first thing to try is to disable powerlevel10k. If this doesn't fix the cursor positioning, there is little chance I'll be able to help.

life404 commented 4 years ago

Thank you very much for your advice. I will try as you suggest.

romkatv commented 4 years ago

I will try as you suggest.

Any luck?

life404 commented 4 years ago

Sorry, I forgot to reply immediately. The problem have been solved, after I restarted my server. But in the end, I don't know what caused the problem. The problem may be a special case of my.

romkatv commented 4 years ago

Thanks for the update.