-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with cursor position when suspending process to background #251
Comments
I cannot reproduce this. Will need some extra info to figure out what's going on.
Is this just on the first prompt after you press Ctrl-Z, or does it persist? Does it get resolved if you type Does it get resolved if you type Do you experience the same issue if you type Please post the output of the following command: () {
setopt
emulate -L zsh
uname -a
typeset -m 'POWERLEVEL9K_*|ZSH_VERSION|ZSH_PATCHLEVEL|ZLE_RPROMPT_INDENT|TERM'
} Can you reproduce this from a shell started with the following command? (
emulate -L zsh
setopt no_unset err_return
local tmp && tmp="$(mktemp -d ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
{
cd $tmp
git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git oh-my-zsh/custom/themes/powerlevel10k
>$tmp/.zshrc echo "
ZSH=${(q)tmp}/oh-my-zsh
plugins=()
ZSH_THEME=powerlevel10k/powerlevel10k
source \$ZSH/custom/themes/powerlevel10k/config/p10k-lean.zsh
source \$ZSH/oh-my-zsh.sh"
ZDOTDIR=$tmp zsh
} always {
cd || true
rm -rf $tmp
}
) |
When your right prompt shifts to the left -- this is the same issue. Let's try to narrow it down. First of all, run this command and restart zsh: git -C $ZSH_CUSTOM/themes/powerlevel10k pull Now let's see if removing oh-my-zsh helps. Run this command: (
emulate -L zsh
setopt no_unset err_return
local tmp && tmp="$(mktemp -d ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
{
cd $tmp
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git
>$tmp/.zshrc echo "
source ${(q)tmp}/powerlevel10k/config/p10k-lean.zsh
source ${(q)tmp}/powerlevel10k/powerlevel10k.zsh-theme
typeset COLUMNS"
ZDOTDIR=$tmp zsh
} always {
cd || true
rm -rf $tmp
}
) Then type If prompt breaks even without oh-my-zsh, see if it breaks without powerlevel10k: (
emulate -L zsh
setopt no_unset err_return
local tmp && tmp="$(mktemp -d ${TMPDIR:-/tmp}/p10k.XXXXXXXXXX)"
{
cd $tmp
>$tmp/.zshrc echo "
setopt prompt_subst
PROMPT='> '
RPROMPT='\${\${(%):-%j}:#0} <'
typeset COLUMNS"
ZDOTDIR=$tmp zsh
} always {
cd || true
rm -rf $tmp
}
) Same thing here: type What terminal are you using? Can you reproduce it with a different terminal? |
Yes, that sounds good. Basically, we are trying to reduce the test case to its absolute minimum. |
Did you have a chance to run the experiments I mentioned? |
Sorry, not yet. I'm going to try and do it tomorrow or on Friday. |
In the future tests you can just hit ctrl-c (without typing anything) to make signal name ( Going over your screenshots once again I see that all right prompts are shifted by The only exception to this rule is one prompt that has Please press ctrl-c while having your regular one-line prompt. You should have your right prompt shifted. Type Can you reproduce this issue in docker? Here's the command: docker run -e TERM -it --rm jonathonf/manjaro bash -uexc '
pacman -Sy --noconfirm sed gzip zsh git
sed -e "s/#en_US.UTF-8/en_US.UTF-8/" -i /etc/locale.gen
locale-gen
export LANG=en_US.UTF-8
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo "source ~/powerlevel10k/config/p10k-lean.zsh" >>~/.zshrc
echo "source ~/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
cd ~/powerlevel10k
exec zsh' Type I've asked you earlier to try to reproduce this problem with a different terminal. Have you? Can you guess what might be the cause of this problem? You are using the most popular version of zsh and one of the most popular terminals and yet you are the only one who experiences this issue. What's special about your setup? Any clue might help. |
This narrows it down quite a bit. That 73 is wrong. It should be 71. Let's see what causes it. Post the output of this: print -lr -- \
${(m)#${:-$'%b%k%160F\M-b\M-\C-F\M-5 INT%b%k%160F%b%k%160F %b%k%66F11:43:24%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$'\M-b\M-\C-F\M-5 INT%b%k%160F%b%k%160F %b%k%66F11:43:24%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$' INT%b%k%160F%b%k%160F %b%k%66F11:43:24%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$'%b%k%160F%b%k%160F %b%k%66F11:43:24%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$' %b%k%66F11:43:24%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$'11:43:24%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$'%b%k%66F%b%k%66F%b%k%f'}} \
${(m)#${:-$'%b%k%66F%b%k%f'}} \
${(m)#${:-$'%b%k%f'}} Also this: zmodload zsh/parameter
echo $options[multibyte]
locale And this: print -lr -- $'>\u21b5<' ${(m)#${:-$'\u21b5'}}
This is no longer necessary. The problem isn't with your terminal.
That |
I found it! My .bashrc included the following line to set the terminal language to English, although I'm using a German system: What is the correct way to set the terminal output to English in my case? Obviously, my approach broke something. |
Yes, it broke UTF-8 support. Locale If you really want to do it via I'm going to close this issue as it's not related to p10k and you are on the way to fix your system properly. |
Thanks a lot for your time and effort, I appreciate it! |
Hi,
I'm using oh-my-zsh (clean install, default config) with p10k as a theme. I'm experience the following problem: When I open a foreground process from the shell, say
vim
orhtop
, and then suspend that job using Ctrl+Z, the cursor is in the wrong position, shifted to the left, overlapping the path or the ">" symbol. Only terminating the background (fg
, then Ctrl+C) process seems to reset everything to normal. Necessary fonts are installed andunset ZLE_RPROMPT_INDENT
as suggested by the FAQ does not seem to solve the issue.Steps to reproduce:
vim
orhtop
.I'm using Linux 4.19.69-1-MANJARO x86_64.
Here is my .zshrc:
Any hints on how to solve that problem are appreciated!
The text was updated successfully, but these errors were encountered: