[SOLVED] zsh prompt colors misaligns the prompt

Im using urxvt.
For some reason, using colors in zsh somewhat screws up my prompt.
In effect, the cursor ends up inside the left hand prompt (see screenhot).
Also; the right hand prompt gets indented about 5 spaces to much from the right.
This is my .zshrc:
#open tmux on startup
#[[ $TERM != "screen" ]] && tmux && exit
autoload -Uz compinit
compinit
#zstyle ':completion*' menu select
#setopt completealiases
#autoload -U promptinit
#promptinit
autoload -U colors && colors
function precmd () {
local battp=$(ibam --percentbattery | grep % | awk '{print $3}')
RPROMPT="[%~] [$battp]"
PROMPT="[%n@%m:]$ "
#keybindings
bindkey "^[[7~" beginning-of-line # Home
bindkey "^[[8~" end-of-line # End
bindkey "^[[5~" history-beginning-search-backward # PageUp
bindkey "^[[6~" history-beginning-search-forward # PageDown
bindkey "^[[2~" quoted-insert # Ins
bindkey "^[[3~" delete-char # Del
bindkey "^[[1;5C" forward-word
bindkey "\eOc" emacs-forward-word
bindkey "^[[1;5D" backward-word
bindkey "\eOd" emacs-backward-word
bindkey "^[[Z" reverse-menu-complete # Shift+Tab
HISTFILE=~/.histfile
HISTSIZE=65536
SAVEHIST=65000
#aliases
alias ls='ls --color=auto'
alias df='df -hT'
alias cl='clear'
alias ll='ls -l'
alias la='ls -A'
alias free='free -m'
alias wcu='wicd-curses'
# The following lines were added by compinstall
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' file-sort name
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[. -]=** r:|=**'
zstyle ':completion:*' menu select=0
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
zstyle :compinstall filename '/home/bladt/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=15000
bindkey -e
# End of lines configured by zsh-newuser-install
It seems to have been messed up a little by compinit, lets pretend that didn't happen
(note that "autoload -U promptinit" and "promptinit" are commented out. This doesnt seem to change anything though)
Last edited by Bladtman242 (2012-02-17 17:59:34)

Well, yeah actually. It's the colours
Adding a color in the left-hand prompt moves the right-hand prompt to far to the left.
Adding a color to the right-hand prompt misplaces the cursor
Any suggestions?
EDIT: If I come across seeming a bit smug, it is unintended. Promise
Last edited by Bladtman242 (2012-02-15 23:18:54)

Similar Messages

  • Setting Global Prompt Color

    I have setup my bashrc prompt colors exactly the way I want them. My issue is that some scripts and apps change the color back to the default gray. I would like to change this behaviour and have no idea where to procede.
    EDIT: What i need to change is the default system prompt color. Any ideas on how to do so?
    Last edited by orphius (2009-04-03 11:07:53)

    pacman is one and rkhunter is another. Also here is my PS1 entry in case it might help
    PS1='\[\033[1;36m\]\d\[\033[0m\]\[\033[1;36m\] \@ \[\033[0m\]\n\[\033[1;32m\]\u\[\033[0m\]\[\033[1;37m\] @ \[\033[0m\]\[\033[1;32m\]$PWD\[\033[0m\]\[\e[1;36m\] \$ '
    I know there is a way to change the system default font color in runlevel3 I think thats what I need to change. Its the font color not the background i want to change
    Last edited by orphius (2009-04-03 14:59:03)

  • Af:showDetail and commandButton in the prompt

    Hi All --
    I hope someone out there can help me out. I have a af:showDetail component with a facet for the prompt. In the prompt facet, I have some text followed by a command button. Here is my problem, I am finding that the command button will only successfully execute if the showDetail component is set to be shown, otherwise, the button does not execute the action. Here is an example:
    <af:showDetail disclosed="false">
      <f:facet name="prompt">
        <af:panelGroup>
          <af:outputText value="Some Text For the Prompt" />
          <af:commandButton text="test" action="testAction" />
        </af:panelGroup>
      </f:facet>
      <af:outputText value="Here is the detail" />
    </af:showDetail>When the detail is closed, I can click on the test button, but it just reloads the page without actually executing the testAction. When the detail is expanded, I click on the test button and the testAction code is executed correctly.
    Does anyone know if there is some sort of way to work around this issue? Thanks for any help you can lend.
    -- Todd

    You're here in a Sun forum, not an Oracle forum. I don't have experience with ADF faces and I doubt if ADF boys walk around here. You will likely make more chance on a suitable answer at the Oracle forum [1].
    [1] http://forums.oracle.com/forums/forum.jspa?forumID=83

  • BE3000,E1 line out, internal IP PHONE normal phone call, phone prompt reversal of "The number dialed is empty" how to solve

    HI,
    BE3000,E1 line out, internal IP PHONE normal phone call, phone prompt reversal of "The number dialed is empty" how to solve
    thanks

    We need traces to figutr out what the problem is. Please make the call, download traces from the diagnostics page and send it.
    Thanks

  • [Solved] Zsh prompt issues

    Hello,
    Ive recently restored my arch system from a backup due to some problems. However I am now having an issue with my zsh prompt.
    I have a .zshrc file in my home dir that was always obeyed by zsh before. Now when I log in the ~/.zshrc file is loaded because all my aliases still work but my prompt is not the one specified in ~/.zshrc file.
    If I copy ~/.zshrc to /etc/zsh/zshrc then the prompt is loaded along with all the other aliases etc.
    Can anyone suggest why this maybe as id like to keep the zsh settings on a per-user basis?
    Thanks
    EDIT: Sorry fixed by reinstalling zsh
    Last edited by ck3mp (2013-04-07 13:01:27)

    Not sure if this is directly relevant to your situation or not, but I encountered a very similar issue starting the other week; loading promptinit and selecting a theme would work, but setting a custom PS1= etc. through my ~/.zshrc no longer did, even though it was still being loaded. I similarly did not think to re-install the package, until I came across this thread. As part of doing so I had to remove several packages with a Zsh dependency. After re-installing Zsh, my normal PS1 etc. came back, but went away again after re-installing the other packages.
    In my case, it appears extra/grml-zsh-config was the culprit; this package adds a lengthy /etc/zsh/zshrc, and the behaviour occurs when that file is present. I couldn't say if this is a bug or just intended behaviour (indeed, I only had GRML-Zsh-Config installed as a dependency for another package); either way, once identified, workarounds became possible.
    Would be curious to know if this was also the case at your end (and if not, well... it seems there are a number of ways one can lose their Zsh prompt configuration!)

  • [SOLVED] git script doesn't update prompt in zsh

    I followed instructions on the wiki page for git copied the git-promp.sh to my home dir, source it .zshrc and then added the variables to my prompt.  The git status prompt does not update when I switch in or out of a directory or execute a command, but it does properly update if I source the .zshrc file manualy.
    Shouldn't it update on every command or did i miss something?
    Last edited by livinglifeback (2013-05-02 01:52:59)

    It depends how the variables are used in your zshrc.  As a basher,  I don't remember exactly what they are called, but there are functions that are run before each command - you need to define your prompt there.  Also improper quoting will make these variables only be expanded once when the file is read rather than every time the prompt is evaluated.
    I suspect the latter is the problem - but in either casse, posting the relevant part of your zshrc will sort it out.

  • Some terminal color functions, including directory-based prompt colors

    All of this code is taken from my ~/.bashrc. Note that some variables are outside of functions. It should be easy to adapt everything below to your own preferences.
    This is my PS1 prompt. Note how the color variables are used.
    COLOR_1="\[\e[1;37m\]"
    COLOR_2="\[\e[0;37m\]"
    COLOR_3="\[\e[1;34m\]"
    COLOR_4="\[\e[1;30m\]"
    function set_ps1()
    PS1="\n${COLOR_3}┌─[${COLOR_2}\u${COLOR_3}@${COLOR_4}\h ${COLOR_2}\w${COLOR_3}]\n${COLOR_3}└─> ${COLOR_2}"
    set_ps1
    A while ago I wrote this function to change the color of "decorations" in the prompt. It works by changing one of the color variables. If invoked with a number it will set the corresponding color, otherwise it will choose a random color from the available palette.
    _palette=$(tput colors)
    function color()
    NUMBER=$1
    if [ -z "$NUMBER" ]; then
    NUMBER=$[ ( $RANDOM % $_palette ) + 1 ]
    echo "number $NUMBER"
    fi
    COLOR_3="\[\e[0;38;5;${NUMBER}m\]"
    set_ps1
    Recently, when I was playing with colors, I also wrote this function to display the 256-color palette so I could easily choose a color to pass to the function above. If you pass it an argument, it will display the palette in a wide format.
    function colors()
    for NUMBER in $(seq 0 15); do
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    done
    echo ""
    if [ -z "$1" ]; then
    for _I in $(seq 0 5); do
    for _J in $(seq 0 5); do
    for _K in $(seq 0 5); do
    NUMBER=$((16 + $_I + 6 * $_J + 36 * $_K ))
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    done
    echo -n " "
    for _K in $(seq 0 5); do
    NUMBER=$((16 + 36 * $_I + $_J + 6 * $_K))
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    done
    echo -n " "
    for _K in $(seq 0 5); do
    NUMBER=$((16 + 6 * $_I + 36 * $_J + $_K))
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    done
    echo ""
    done
    echo ""
    done
    else
    for _I in $(seq 0 5); do
    for _J in $(seq 0 5); do
    for _K in $(seq 0 5); do
    NUMBER=$((16 + 6 * $_I + $_J + 36 * $_K))
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    #echo -n " $_I$_J$_K"
    done
    echo -n " "
    done
    echo ""
    done
    echo ""
    for _I in $(seq 0 5); do
    for _J in $(seq 0 5); do
    for _K in $(seq 0 5); do
    NUMBER=$((16 + $_I + 36 * $_J + 6 * $_K))
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    #echo -n " $_I$_J$_K"
    done
    echo -n " "
    done
    echo ""
    done
    echo ""
    for _I in $(seq 0 5); do
    for _J in $(seq 0 5); do
    for _K in $(seq 0 5); do
    NUMBER=$((16 + 36 * $_I + 6 * $_J + $_K))
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    #echo -n " $_I$_J$_K"
    done
    echo -n " "
    done
    echo ""
    done
    echo ""
    fi
    for NUMBER in $(seq 232 255); do
    printf "\e[0;38;5;${NUMBER}m%4d" $NUMBER
    done
    Even more recently, I've been using certain colors to provide visual cues about directory location that let me quickly scan open terminals to find the one I want, so I've written this function, which will change the PS1 prompt based on directory. Just add in cases as you need them and change the colors as you like (the colors below are just an example). You can use it synonymously with "cd".
    function ccd()
    cd $@
    _dir=$(pwd)/
    case $_dir in
    ~/projects/*)
    color 202
    /tmp/*)
    color 49
    /usr/*)
    color 190
    color 12
    esac
    Use this thread to post your own terminal color functions or variations of others that you've found here, along with feedback, discussion, etc.

    I expect this to become something of a bargain bin for terminal color functions. A bit of rummaging might turn up a few gems, but most of it will be worthless crap to most.

  • Follow-up to earlier question; you asked me by email to confirm that I asked a question. I did. The question was: if I don't get a prompt to drag the ff icon into my Applications file, how do I do so?

    I downloaded the latest version of Firefox as requested. I was told to drag the icon to my Application file when prompted. The download was successful, but I never got the prompt. And so I still have the old version of Firefox (3.6.24) and the home page still tells me I'm using an out-dated version. So what do I do?

    Installing Firefox on Mac:
    http://support.mozilla.com/en-US/kb/Installing%20Firefox%20on%20Mac
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • Change the colour of the prompt and the value

    Hi,
    I have an Item MessageStyledText with some value on an OAF Page.
    By default the colour of the Prompt and the value of this Item are black.
    But i need to change the Colour to Blue.
    Fast response highly appreciated.
    Thanks,
    Palepu.

    Approach 1:
    Custom Look and Feel - Create your CLAF and change CSS Style.
    Limitation - The main limitation of the Custom Look and Feel functionality is that you can only extend Simple LAF or Base LAF, which do not include all the functionality of the Browser LAF (BLAF) or SWAN.
    Approach 2:
    You can do it programmetically as follows:
    import oracle.cabo.style.CSSStyle;
    CSSStyle customUnCss = new CSSStyle();
    customUnCss.setProperty("text-transform","uppercase");
    customUnCss.setProperty("color", "#FF0000");
    OAMessageStyledTextBean sampleBean = (OAMessageStyledTextBean) webBean.findChildRecursive("<Id of your messageStyleText will come here>");
    if(sampleBean != null)
    sampleBean.setInlineStyle(customCss); //set custom css style
    You need to provide more details to get more appropriate solution/workaround.

  • How to create a presentation variable outside the prompt in OBIEE 10.1.3.4?

    I am having a situation as below:
    I have a "Month" and "Year" dashboard Prompt.
    Once the user selects a particular Month and year, that particular month's end date should be defined as a presentation variable. (For example, if the user selects 'September' and 2011 then '30-sep-2011' should be the presentation variable).
    I dont want the Month End Date to be a part of the prompt.
    Please suggest.

    Hi
    if you have access to metalink, there is a patch..released by oracle.
    i had this same issue and solved it by applying the patch.
    instructions are given in that patch release on how to apply that.
    just replace the DAWServer.jar file in DAC/ Folder by taking a backup of exisitng one
    thank you
    kumr

  • How do I change my flash settings? I said I wanted to be prompted about flash wanting to store things on my computer but the prompts are too frequent and annoying!

    How do I change my flash settings? I said I wanted to be prompted about flash wanting to store things on my computer but the prompts are too frequent and annoying!

    New versions of Flash have a panel installed on your system for control of settings.
    In Windows XP, Windows Start > Settings > Control Panel > Flash Player, click on each tab and change the "Ask..." setting. Most likely your prompts are coming from the "Storage" tab. Using any of the "Block..." settings may make Flash inoperative on some sites.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Setting the Prompt Message in a Bex Report Charactorstic Filter Window.

    Hello Experts,
    Recently my project was enhanced with some more new project and mixed it with my project.
    Now my issue is before my new project was mixed into old project. We have the option..when a Charactorstics in Free Charactoristics (Ex: Customer, material ) context menu we come to see the option Select Filter Value and Filter Window opens.
    In that my old project, for the users comfortability and for knowing to users that there are more than n no of materials avaialble like that..in that filter they put one prompt message " has more than n values ".
    But after mixing up the enhanced new project, now..we are unable to see the above prompt message in Filter window..when material drill down.
    User requirement is to again users need to see that kind of prompt in the charactoristics filter window and this requirement is needed for Query Level and is for two or three reports only.
    I come to know some solution like in WAD web template under web items section Do not display system messages check box is now..Ticked. By un checking that option this issue will be solved like that. But i had tried in that manner but no use.
    And also i got one more solution that in WAD XHTML Coding section we can set this feature like that.
    Here my question is how to find XHTML Coding Section in WAD. Because i already tried to check in HTML coding section but couldnt find tha option.
    Requesting you , please reply me based on the solutions which i know can suggest further, or else if any body faced this kind of issue in your projects or come to know from ur end.
    Thanks,
    SN.

    Hi  Experts,
    Just i wanted to update one more thing..regarding this issue..
    Currently the in the prompt Maximum no of hits has set as 200.
    user is asking to have a prompt of more than 200 values in the report.

  • 大家帮帮忙呀,真是苦恼呀!The date for the prompt 'startDate' is invalid. (WIS 10706)

                   IInfoObject report = (IInfoObject) objects.get(0);
                   IWebi webi = (IWebi) report;
                   // u83B7u5F97u63D0u793Au53C2u6570
                   di = getReportEngine().openDocument(report.getID());
                   di.refresh();
                   // u8BBEu7F6Eu53C2u6570
                   if (params != null)
                        Prompts prompts = di.getPrompts();
                        int promptNum = prompts.getCount();
                        for (int j = 0; j <= promptNum - 1; j++)
                             Prompt p = (Prompt) prompts.getItem(j);
                             if(params.get(p.getName())!=null)
                                  //u68C0u6D4Bu662Fu5426u5E26u6709u7A7Au5B57u7B26
                                  String temp[]=(String[])params.get(p.getName());
                                  boolean falg=false;
                                  for(int len=0;len<temp.length;len++)
                                       if(temp[len]==null)
                                            falg=true;
                                       else if("".equals(temp[len].trim()))
                                            falg=true;
                                  if(falg)
                                       continue;
                                  //u5BF9u65E5u671Fu6570u7EC4u8FDBu884Cu8F6Cu6362
                                  if("DATE".equalsIgnoreCase(p.getObjectType().toString()))
                                       String formatStr=p.getInputFormat();
                                       for(int x=0;x<temp.length;x++)
                                            temp[x]=DateUtil.DateToString(DateUtil.StringTODate(temp[x]),formatStr);
                                  System.out.println(p.getName()+"u503C  "+temp[0]);
                                  p.enterValues(temp);
                        PromptsUtil.populateWebiPrompts(di.getPrompts(), webi);
                   // u540Eu7F00u540Du79F0
                   if (format !=EXCEL && format != PDF && format !=Webi)
                        throw new Exception(" u751Fu6210u62A5u8868u5B9Eu4F8Bu683Cu5F0F,u53EAu63A5u6536EXCEL,PDF,Webiu683Cu5F0Fu53C2u6570!");
                   webi.getWebiFormatOptions().setFormat(format);
                   ISchedulingInfo scheduleInfo = report.getSchedulingInfo();
                   scheduleInfo.setType(0);
                   //u662Fu5426u53D1u9001u90AEu4EF6
                   if(isSendMail)
                        doSendMail(scheduleInfo,report,
                                  format,message,title,recipientAddresses,CCAddresses);
                   //u8BBEu7F6Eu81EAu5B9Au4E49u503C
                   if(properties!=null && !"".equals(properties))
                        report.properties().setProperty(CUSTOMVALUE,properties);
                   scheduleInfo.setRightNow(true);
                   // u751Fu6210u5B9Eu4F8B
                   getIInfoStore().schedule(objects);
    上述代码片段为BO生成实例的过程,程序不会出错。但BO报表历史记录中,提示:The date for the prompt 'startDate' is invalid. (WIS 10706)
    刚开始认为:日期格式错误,我便加上了
    if("DATE".equalsIgnoreCase(p.getObjectType().toString()))
           String formatStr=p.getInputFormat();
           for(int x=0;x<temp.length;x++)
                  temp[x]=DateUtil.DateToString(DateUtil.StringTODate(temp[x]),formatStr);
    需且验证日期格式,正是p.getinputFormat()所要求的格式,可BO历史记发中,生成实例还是报上述错误。
    Edited by: pyantking on Jul 27, 2009 2:39 PM

    Hello Anh,
    With XI 3.1 some significant fixes were delivered to address issues like you describe : create a query with QaaWS Designer using date input parameters (prompts) with a given locale, then edit (with QaaWS Designer) the query under another different locale, where dates are set with a different format.
    AFAIK QaaWS queries keep the locale under which they were created, fixes were aimed at translating input parameters in the right format so errors like the one you describe should not be encountered.
    i suggest you get in touch with the SAP BusinessObjects tech support with your issue, so we will be able to investigate further in conjunction with QaaWS dev team and work out a fix, if this turns out to be a bug.
    BTW, Have you considered upgrading to a more recent Service Pack? Business Objects Enterprise XI 3.1 SP3 is now available since 2010 Q2 (no guarantee, though, that this issue would be solved with this SP)
    Hope that helps,
    David.

  • Changing Color of Command Prompt

    Does anyone know how to change the color of the command prompt using java coding? I am using cmd as my UI.
    thanks alot..

    Look for JCurses, I think it might be able to do that. Otherwise, there is nothing in Java that lets you do it. The coloring of the console is platform specific.

  • [Solved] Terminal launches pacman before giving prompt...strange

    Hi. Since about two days (I can't point on it) prompts show up with a large delay when starting any terminal-emulator (tried urxvt, lxterminal and xterm) or log in from tty.
    Between starting the terminal and the prompt showing up, there is constant access to my HDD. Top-listed process in top is pacman and it disappears, when the prompt shows up.
    This also happens directly after booting which causes X to start (from .bash_profile) in delay, too.
    My .bash_profile and .bashrc don't seem to cause it.
    Here they are:
    .bashrc: http://ix.io/zh
    .bash_profile: http://ix.io/zi
    Please ignore my ridiculous .bashrc Wanted to keep it in original state. The PS1-string was messed up while transferring. I guess this doesn't import...
    Any ideas what could cause pacman being launched?
    Thanks in advance!
    Last edited by panuh (2009-12-01 22:55:51)

    Yep, that caused it. Thanks for the fast reply!
    I didn't know there was a difference between the quotes. I'll look that up.
    Solved!
    EDIT: Oh, I get it. The double quotes let the dollar-sign retain its meaning, so pacman is executed. I could have figured that...
    Last edited by panuh (2009-12-01 23:01:05)

Maybe you are looking for