Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ZSH cursor issue
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
PsyGhost
n00b
n00b


Joined: 18 May 2005
Posts: 25

PostPosted: Fri Apr 19, 2013 8:09 am    Post subject: [SOLVED] ZSH cursor issue Reply with quote

I'm using KDE's Konsole as a terminal. My local system is running Sabayon (Gentoo testing branch) and I use it to preform SSH to a remote Gentoo system which is based on the stable branch. Both systems have the same ZSH version, ZSH configuration, ZSH use flags and readline version.
However, in the remote Gentoo system, sometimes the shell cursor location is wrong, overriding the prompt.

Prompt in Sabayon:
http://postimg.org/image/ujcl1nlqn/

Prompt in Gentoo:
http://postimg.org/image/60kvify8j/

I read here that such issues can occur of the LANG environment variable is not set properly. The LANG variable in the Gentoo system was indeed unset, but even setting it did not resolve my problem.


Last edited by PsyGhost on Fri Apr 19, 2013 9:26 am; edited 1 time in total
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Fri Apr 19, 2013 8:30 am    Post subject: Reply with quote

Do the locale you set actually exist?
Could you post the output of locale -a and locale
Back to top
View user's profile Send private message
PsyGhost
n00b
n00b


Joined: 18 May 2005
Posts: 25

PostPosted: Fri Apr 19, 2013 8:37 am    Post subject: Reply with quote

locate:
Code:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


locale -a
Code:
C
en_US
en_US.iso88591
en_US.utf8
POSIX


There's something else that I just noticed: When running a new ZSH instance from ZSH (or running a tmux), the new instance of ZSH doesn't suffer from this issue, but my first ZSH instance still does. However, running env in the first ZSH instance shows that the LANG variable is property set. I tried to logout and login several times, and even restart the SSHD service, but the issues still continue only in the first ZSH instance. I cannot afford to reboot right now, but I also can't think of why a reboot would help.
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Fri Apr 19, 2013 8:51 am    Post subject: Reply with quote

I THINK I remember I had similar issues. The problem for me was the way I colored my prompt.
This works for me:
Code:
$ cat .zsh.d/S60_prompt
autoload colors zsh/terminfo
autoload -Uz vcs_info

colors

PROMPT="%{%F{green}%}[%T] %{%f%}$ "

RPROMPT_BASE="%{%F{cyan}%}[%d]"

zstyle ':vcs_info:*' actionformats \
    '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats       \
    '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'

zstyle ':vcs_info:*' enable bzr hg git svn

rprompt_info() {
  vcs_info
  if [ -n "$vcs_info_msg_0_" ]; then
    echo "%{$fg[grey]%}${vcs_info_msg_0_}%{$reset_color%}$del"
  else
    echo "[%D{%a, %d. %b. %Y}]%{%f%}"
  fi
}

RPROMPT="${RPROMPT_BASE} "$'$(rprompt_info)'

To check if it is caused by (bad) coloring you can disable it completely ;)
Back to top
View user's profile Send private message
PsyGhost
n00b
n00b


Joined: 18 May 2005
Posts: 25

PostPosted: Fri Apr 19, 2013 9:01 am    Post subject: Reply with quote

I did see some posts over the internet that say it might be cause by bad color prompt. However, I use a community developed configuration named zprezto so I don't think it's a bug in the configuration. I also tried to switch to some other pre-made prompts - all suffer from this issue. Moreover, I never had issues with this configuration in Sabayon or in Ubuntu, so I must be doing something wrong in my Gentoo installation.

I did managed to reboot the server, but it still didn't resolve my issue. The cursor bug still occur when I log in, but if I run tmux of another ZSH instance, the new instance seems to be OK.
Very odd...
Back to top
View user's profile Send private message
PsyGhost
n00b
n00b


Joined: 18 May 2005
Posts: 25

PostPosted: Fri Apr 19, 2013 9:26 am    Post subject: Reply with quote

I did some more searching and found this. I looked at the SSH configuration files in Sabayon and they did contain the given patch. Applying it to the sshd_config file in Gentoo solved the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum