Zsh RPROMPT Causes Extra Spaces












0















Below is my zsh prompt configuration. Within xterm, urxvt, and iterm2 the entire prompt displays as expected - however, within Emacs (eterm) and Intellij terminals the display is off where the cursor is one full line below the left prompt - effectively the equivalent of ssr immediately following the left prompt.



I've attempted to debug the prompts and commenting the RPROMPT solves the problem. Does anyone see any issues with the RPROMPT configuration?



precmd() {
vcs_info
}

zstyle ':vcs_info:git*' formats '%b'

setopt PROMPT_SUBST

BRANCH_MARK=$'ue0a0'
ARROW_PROMPT=$'u2192'
STATUS="%(?:%{$fg[green]%}$ARROW_PROMPT:%{$fg[red]%}$ARROW_PROMPT)"

scm_branch() {
if [ -n "${vcs_info_msg_0_}" ]; then
echo -e "${BRANCH_MARK} ${vcs_info_msg_0_}"
fi
}

PROMPT='%n@%m:%{$fg[cyan]%}%~%{$reset_color%}%# ${STATUS} %{$reset_color%}'
RPROMPT='$(scm_branch) [%*]'









share|improve this question

























  • It's a little unreasonable to ask people to explain a visible effect with only a vague and cursory mention of what the visible effect is. You really should edit the question to show potential answerers what spaces, how many spaces, and exactly where they are occurring. You haven't even told people enough to determine which of those two prompts to look at, and that's basic minimal information about which side of the screen this is happening on.

    – JdeBP
    5 hours ago













  • I would suspect those unicode characters are running afoul of something, but don't use a prompt so fancy. Maybe look at the MULTIBYTE option or the %G prompt escape?

    – thrig
    3 hours ago











  • @JdeBP The posted configuration was my first attempt at configuring a zsh prompt, therefore thought the issue would be the result of an obvious syntactical oversight - hence the limited contextual information. In any event, while attempting to debug the issue, determined the cause is the RPROMPT. I've accordingly updated post. Thanks.

    – Ari
    2 mins ago
















0















Below is my zsh prompt configuration. Within xterm, urxvt, and iterm2 the entire prompt displays as expected - however, within Emacs (eterm) and Intellij terminals the display is off where the cursor is one full line below the left prompt - effectively the equivalent of ssr immediately following the left prompt.



I've attempted to debug the prompts and commenting the RPROMPT solves the problem. Does anyone see any issues with the RPROMPT configuration?



precmd() {
vcs_info
}

zstyle ':vcs_info:git*' formats '%b'

setopt PROMPT_SUBST

BRANCH_MARK=$'ue0a0'
ARROW_PROMPT=$'u2192'
STATUS="%(?:%{$fg[green]%}$ARROW_PROMPT:%{$fg[red]%}$ARROW_PROMPT)"

scm_branch() {
if [ -n "${vcs_info_msg_0_}" ]; then
echo -e "${BRANCH_MARK} ${vcs_info_msg_0_}"
fi
}

PROMPT='%n@%m:%{$fg[cyan]%}%~%{$reset_color%}%# ${STATUS} %{$reset_color%}'
RPROMPT='$(scm_branch) [%*]'









share|improve this question

























  • It's a little unreasonable to ask people to explain a visible effect with only a vague and cursory mention of what the visible effect is. You really should edit the question to show potential answerers what spaces, how many spaces, and exactly where they are occurring. You haven't even told people enough to determine which of those two prompts to look at, and that's basic minimal information about which side of the screen this is happening on.

    – JdeBP
    5 hours ago













  • I would suspect those unicode characters are running afoul of something, but don't use a prompt so fancy. Maybe look at the MULTIBYTE option or the %G prompt escape?

    – thrig
    3 hours ago











  • @JdeBP The posted configuration was my first attempt at configuring a zsh prompt, therefore thought the issue would be the result of an obvious syntactical oversight - hence the limited contextual information. In any event, while attempting to debug the issue, determined the cause is the RPROMPT. I've accordingly updated post. Thanks.

    – Ari
    2 mins ago














0












0








0








Below is my zsh prompt configuration. Within xterm, urxvt, and iterm2 the entire prompt displays as expected - however, within Emacs (eterm) and Intellij terminals the display is off where the cursor is one full line below the left prompt - effectively the equivalent of ssr immediately following the left prompt.



I've attempted to debug the prompts and commenting the RPROMPT solves the problem. Does anyone see any issues with the RPROMPT configuration?



precmd() {
vcs_info
}

zstyle ':vcs_info:git*' formats '%b'

setopt PROMPT_SUBST

BRANCH_MARK=$'ue0a0'
ARROW_PROMPT=$'u2192'
STATUS="%(?:%{$fg[green]%}$ARROW_PROMPT:%{$fg[red]%}$ARROW_PROMPT)"

scm_branch() {
if [ -n "${vcs_info_msg_0_}" ]; then
echo -e "${BRANCH_MARK} ${vcs_info_msg_0_}"
fi
}

PROMPT='%n@%m:%{$fg[cyan]%}%~%{$reset_color%}%# ${STATUS} %{$reset_color%}'
RPROMPT='$(scm_branch) [%*]'









share|improve this question
















Below is my zsh prompt configuration. Within xterm, urxvt, and iterm2 the entire prompt displays as expected - however, within Emacs (eterm) and Intellij terminals the display is off where the cursor is one full line below the left prompt - effectively the equivalent of ssr immediately following the left prompt.



I've attempted to debug the prompts and commenting the RPROMPT solves the problem. Does anyone see any issues with the RPROMPT configuration?



precmd() {
vcs_info
}

zstyle ':vcs_info:git*' formats '%b'

setopt PROMPT_SUBST

BRANCH_MARK=$'ue0a0'
ARROW_PROMPT=$'u2192'
STATUS="%(?:%{$fg[green]%}$ARROW_PROMPT:%{$fg[red]%}$ARROW_PROMPT)"

scm_branch() {
if [ -n "${vcs_info_msg_0_}" ]; then
echo -e "${BRANCH_MARK} ${vcs_info_msg_0_}"
fi
}

PROMPT='%n@%m:%{$fg[cyan]%}%~%{$reset_color%}%# ${STATUS} %{$reset_color%}'
RPROMPT='$(scm_branch) [%*]'






zsh prompt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 mins ago







Ari

















asked 6 hours ago









AriAri

1162




1162













  • It's a little unreasonable to ask people to explain a visible effect with only a vague and cursory mention of what the visible effect is. You really should edit the question to show potential answerers what spaces, how many spaces, and exactly where they are occurring. You haven't even told people enough to determine which of those two prompts to look at, and that's basic minimal information about which side of the screen this is happening on.

    – JdeBP
    5 hours ago













  • I would suspect those unicode characters are running afoul of something, but don't use a prompt so fancy. Maybe look at the MULTIBYTE option or the %G prompt escape?

    – thrig
    3 hours ago











  • @JdeBP The posted configuration was my first attempt at configuring a zsh prompt, therefore thought the issue would be the result of an obvious syntactical oversight - hence the limited contextual information. In any event, while attempting to debug the issue, determined the cause is the RPROMPT. I've accordingly updated post. Thanks.

    – Ari
    2 mins ago



















  • It's a little unreasonable to ask people to explain a visible effect with only a vague and cursory mention of what the visible effect is. You really should edit the question to show potential answerers what spaces, how many spaces, and exactly where they are occurring. You haven't even told people enough to determine which of those two prompts to look at, and that's basic minimal information about which side of the screen this is happening on.

    – JdeBP
    5 hours ago













  • I would suspect those unicode characters are running afoul of something, but don't use a prompt so fancy. Maybe look at the MULTIBYTE option or the %G prompt escape?

    – thrig
    3 hours ago











  • @JdeBP The posted configuration was my first attempt at configuring a zsh prompt, therefore thought the issue would be the result of an obvious syntactical oversight - hence the limited contextual information. In any event, while attempting to debug the issue, determined the cause is the RPROMPT. I've accordingly updated post. Thanks.

    – Ari
    2 mins ago

















It's a little unreasonable to ask people to explain a visible effect with only a vague and cursory mention of what the visible effect is. You really should edit the question to show potential answerers what spaces, how many spaces, and exactly where they are occurring. You haven't even told people enough to determine which of those two prompts to look at, and that's basic minimal information about which side of the screen this is happening on.

– JdeBP
5 hours ago







It's a little unreasonable to ask people to explain a visible effect with only a vague and cursory mention of what the visible effect is. You really should edit the question to show potential answerers what spaces, how many spaces, and exactly where they are occurring. You haven't even told people enough to determine which of those two prompts to look at, and that's basic minimal information about which side of the screen this is happening on.

– JdeBP
5 hours ago















I would suspect those unicode characters are running afoul of something, but don't use a prompt so fancy. Maybe look at the MULTIBYTE option or the %G prompt escape?

– thrig
3 hours ago





I would suspect those unicode characters are running afoul of something, but don't use a prompt so fancy. Maybe look at the MULTIBYTE option or the %G prompt escape?

– thrig
3 hours ago













@JdeBP The posted configuration was my first attempt at configuring a zsh prompt, therefore thought the issue would be the result of an obvious syntactical oversight - hence the limited contextual information. In any event, while attempting to debug the issue, determined the cause is the RPROMPT. I've accordingly updated post. Thanks.

– Ari
2 mins ago





@JdeBP The posted configuration was my first attempt at configuring a zsh prompt, therefore thought the issue would be the result of an obvious syntactical oversight - hence the limited contextual information. In any event, while attempting to debug the issue, determined the cause is the RPROMPT. I've accordingly updated post. Thanks.

– Ari
2 mins ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499136%2fzsh-rprompt-causes-extra-spaces%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499136%2fzsh-rprompt-causes-extra-spaces%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

宮崎県

濃尾地震

シテ島