Zsh Prompt Alignment Issues












0















Below is my zsh prompt configuration. Within Emacs (eterm) and Intellij terminals the display is compromised. Below is a representation of the display.



%                                             |                                                                                                                                            
ari@machine:~% → [16:38:14]


The issues are:




  1. The existence of a percentage symbol indicating non-privileged shell on
    the top line

  2. The cursor (notice the vertical bar) is located above
    the configured left and right prompts, and far to the right of the screen

  3. The left and right prompts are located next to each other, rather
    than at opposite ends of the screen


Does anyone see any issues with the either of the prompt configurations?



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
    Feb 6 at 20:02













  • 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
    Feb 6 at 22:08











  • @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
    Feb 7 at 1:30
















0















Below is my zsh prompt configuration. Within Emacs (eterm) and Intellij terminals the display is compromised. Below is a representation of the display.



%                                             |                                                                                                                                            
ari@machine:~% → [16:38:14]


The issues are:




  1. The existence of a percentage symbol indicating non-privileged shell on
    the top line

  2. The cursor (notice the vertical bar) is located above
    the configured left and right prompts, and far to the right of the screen

  3. The left and right prompts are located next to each other, rather
    than at opposite ends of the screen


Does anyone see any issues with the either of the prompt configurations?



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
    Feb 6 at 20:02













  • 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
    Feb 6 at 22:08











  • @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
    Feb 7 at 1:30














0












0








0








Below is my zsh prompt configuration. Within Emacs (eterm) and Intellij terminals the display is compromised. Below is a representation of the display.



%                                             |                                                                                                                                            
ari@machine:~% → [16:38:14]


The issues are:




  1. The existence of a percentage symbol indicating non-privileged shell on
    the top line

  2. The cursor (notice the vertical bar) is located above
    the configured left and right prompts, and far to the right of the screen

  3. The left and right prompts are located next to each other, rather
    than at opposite ends of the screen


Does anyone see any issues with the either of the prompt configurations?



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 Emacs (eterm) and Intellij terminals the display is compromised. Below is a representation of the display.



%                                             |                                                                                                                                            
ari@machine:~% → [16:38:14]


The issues are:




  1. The existence of a percentage symbol indicating non-privileged shell on
    the top line

  2. The cursor (notice the vertical bar) is located above
    the configured left and right prompts, and far to the right of the screen

  3. The left and right prompts are located next to each other, rather
    than at opposite ends of the screen


Does anyone see any issues with the either of the prompt configurations?



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 Feb 8 at 1:06







Ari

















asked Feb 6 at 19:02









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
    Feb 6 at 20:02













  • 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
    Feb 6 at 22:08











  • @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
    Feb 7 at 1:30



















  • 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
    Feb 6 at 20:02













  • 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
    Feb 6 at 22:08











  • @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
    Feb 7 at 1:30

















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
Feb 6 at 20:02







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
Feb 6 at 20:02















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
Feb 6 at 22:08





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
Feb 6 at 22:08













@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
Feb 7 at 1:30





@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
Feb 7 at 1:30










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-prompt-alignment-issues%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-prompt-alignment-issues%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

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?