[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!)

Similar Messages

  • [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)

  • [SOLVED] Font problem. Zsh prompt shows strange characters.

    I am seeing strange characters in Zsh prompt only, bash works fine. I probably did not follow the font configuration section of Arch Beginner's Guide properly during installation. Earlier I had problems with login consoles too (tty2, tty3, all those black screens you can go to using CTRL+ALT+F2/F3 etc.) But I fixed those problems by creating /etc/vconsole.conf.
    Zsh problem still remains. I am using oh-my-zsh.
    I am out of ideas as to what to do. Please help.
    Last edited by Hindol (2013-04-23 08:37:47)

    What happens if you remove all the oh-my-zsh stuff?
    From your screenshot it looks like you are in X: you might want to change your thread title as it is a little misleading.
    Check your locale while you are at it.

  • I updated my Iphone 4s to IOS 7, now it reboots after every 2 minutes, I tried to restore, but the reboot gets it disconnected from PC, help me solve this reboot issue..

    I updated my Iphone 4s to IOS 7, now it reboots after every 2 minutes, I tried to restore, but the reboot gets it disconnected from PC, help me solve this reboot issue..

    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...
    But... if the Device has been Modified... this will Not necessarily work.

  • Urxvt and zsh prompt

    Hello!
    I would like to run different instances of Urxvt using "-name", each one with a different zsh prompt.
    Is there any way to achieve this?
    "PROMPT=" works if urxvt is already open, but I can't seem to find a way to run it when it starts.
    Thanks.

    In bash you can update /home/user/.bashrc . I am not a zsh user but after a quick look at the man page there appears to be a .zshrc file that does the same.
    Hope this helps.

  • What's the perfect CHINESE FONT for iWeb to solved the Justified issue?

    Hi,
    Terible here, i'm using Chinese Font for my website...most of the Text Box were out of Justified unlike the perfect justified on English Font.
    Sorry i hope you understand what i'm trying to descript above.
    I'm wondering now, Is there any specific Chinese Font to solved the Justified issue?
    Now, everything looks fine in iWeb but when view it in Safari or any browser, there'll be out of Justified.
    Need helps and thanks!!!

    Could you provide your url so people can see what you are referring to?
    Have you tried the various Chinese fonts provided with OS X already?
    http://www.yale.edu/chinesemac/pages/fonts.html#Apple

  • I dropped my iphone 4 into the water and then i tried the rice method. The rice solved the water issue but now the screen won't work. what should i do?

    I  dropped my iphone 4 into the water and then i tried the rice method. The rice solved the water issue but now the screen won't work. what should i do?

    I guess your definition of "solved" is different from most...
    Make an appointment at the genius bar of your local Apple Store and get an out of warranty replacement.

  • Solving Centro hotsync issues without a hard reset

    I have a Centro (sprint).  I am running Windows Vista.  I cannot connect with hotsync.  Whenever I try, I get the following message -- "The connection between your handheld computer and the desktop could not be established.  Please check your setup and try again."  I went through the article referenced at the beginning of this forum and performed all the suggestions (reloaded Palm desktop 6.2, the outlook 2007 update, soft restart, etc.).  I took it to a repair center and they stated the ONLY way to fix it was to do a hard reset which would lose all info.  Since I can't hotsync, I haven't been able to backup the phone which means I'll lose everything.  I'm hoping there are some other suggestions I could try.  It seems contrary that the only way to solve a hotsync issue and save your data is to do a hard reset and lose all your data.  Thanks.
    Post relates to: Centro (Sprint)

    Is your Vista 64 bit or 32 bit? 
    Try performing a warm reset of your device... Take out the battery press and hold the UP button insert the battery while holding the UP navigator button wait until you see set date and time then release the button. Connect the phone back to the PC and try perform a hotsync.

  • Multiline zsh prompt messes RPROMPT

    Hello,
    I have a multiline zsh prompt which is fine, but I'd like to add the hour in the RPROMPT. Unfortunately, the RPROMPT displays at the end of the second line of the prompt, whereas I want it at the first line. What I have looks like this:
    ~
    >>= archey 3:22
    And I would like this:
    ~ 3:22
    >>= archey
    So, I tried adding a control character to move the cursor up one line, but it still doesn't work. Before adding a control char:
    autoload -U colors && colors
    setopt prompt_subst
    PROMPT=$'%{$fg[blue]%}%~%{$reset_color%}
    %{$fg[red]%}>>=%{$reset_color%} '
    RPROMPT="%D{%L:%M:%S}"
    And after:
    autoload -U colors && colors
    setopt prompt_subst
    PROMPT=$'%{$fg[blue]%}%~%{$reset_color%}
    %{$fg[red]%}>>=%{$reset_color%} '
    RPROMPT="\033[1A%D{%L:%M:%S}"
    Could you help me sort this out ?
    Last edited by Mathuin (2014-04-23 14:36:57)

    You may want to move precmd() outside of the setprompt() function ...
    Also, there's no reason to create $PR_COLORS. ZSH supports %B...%b for bold and %F{color}...%f for foreground colors. If you're using a 256 color terminal, you can specify 001-255 in %F{}.
    Here is my prompt;
    setprompt () {
    # Need this so the prompt will work.
    setopt prompt_subst
    # see if we can use colors.
    autoload colors zsh/terminfo
    colors
    if [[ $UID == 0 ]] ; then
    PROMPT='[%B%F{red}%n%f%b@%F{green}%m%f:%y] %B%F{yellow}%~%f%b %# '
    else
    PROMPT='[%F{025}%n%f@%F{200}%m%f:%y] %B%F{035}%~%f%b %# '
    fi
    setprompt
    See also
    man zshall | less -p "Visual effects"

  • How i can solve the facetime issue? I cant find it in apple store !!!!! Plaese advice me ..., iphone 5, How i can solve the facetime issue? I cant find it in apple store !!!!! Plaese advice me ..., iphone 5

    How i can solve the facetime issue? I cant find it in apple store !!!!! Plaese advice me ..., iphone 5, How i can solve the facetime issue? I cant find it in apple store !!!!! Plaese advice me ..., iphone 5

    Facetime is not in the App store. It is part of the iOS. You access Facetime on the phone via the contact section. Facetime needs to be activated in Settings. The only reason you may not have it is if you purchased the device in an area where Facetime is prohibited by law.

  • My free trial has expired a week into the trial. I have contacted support and they haven't solved the issue. Stated to use forum to solve my license issue for this computer.

    My free trial has expired a week into the trial. I have contacted support and they haven't solved the issue. Stated to use forum to solve my license issue for this computer.

    Did you have an Adobe trial running on this same computer before?  Maybe your previous trial was used for 3 weeks and then you uninstalled it?  If so, you're only eligible for a 1 week trial on this computer.
    Nancy O.

  • [Solved] $LANG and zsh prompt color problems

    Hi,
    I recently discovered, trying to use Newsbeuter, that, in X, certain parts of my profile aren't set. Until now it only seemed to be $LANG, which is empty if I echo it from urxvt in XMonad, but yields the correct setting if I do the same in a tty.
    To make things worse now, my zsh seems to be acting up. I have differently colored prompts for my normal user and root. But since a few days ago, the root colors aren't applied unless I source .zshrc again after sudo-ing.
    I updated a lot recently and it's gotten hard to track these issues, especially the $LANG one, to a specific update. The only thing I know is that my desktop, running Kdemod, doesn't have these problems.
    I'm using Slim and XMonad. Neither issue is limited to a certain terminal.
    Most of my configs can be found in my GitHub dotfiles repository. If anything's missing to get a clear picture, ask for it.
    My rc.conf can be found here [Gist].
    Last edited by count-corrupt (2010-08-22 13:33:06)

    jac wrote:
    I finally went through the new sudoers file and got mine to work, see this thread for details. Using that, and using a workaround for libetc, your prompt works for me.
    You appear not to use libetc, but if you do and don't also have root set up to use libetc, you will need to create a link to/from ~/.zshrc from/to ~/.config/zshrc
    I actually just solved it in another way. Your original point, that sudo changed it's default behavior was the key. In the official zsh documentation somewhere it says that all settings that are wanted for root should be put into /root/.zshrc. I just did that and it works.
    Your solution works too by the way. Just enabling
    Defaults env_keep += "HOME"
    does the trick and also (logically) re-enables other things that I hadn't even realized were gone yet like syntax highlighting in vim. I guess I should read into the nature of said privilige escalation problems. Maybe there's a way to selectively keep parts of HOME.
    So thank you very much for the help.

  • SOLVED: bash upgrade, prompt issues

    Just did a pacman -Syu and it fetched bash-4.0.033-1. However now whenever a open a bash shell as a user (not root), my prompt has this at the start:
    0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~} (~)
    ... followed by the usual [user@host ~]$
    Now I assume this is caused by this line in profile.bash:
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
    export PROMPT_COMMAND
    Unfortunately there is no backup of said file, so I have no idea what this line used to look like. I'm going to hazard a guess that "\033]0;" should be a "[", and "\007" should be "]".
    Edit: Forgot to mention that I'm using rxvt-unicode for the terminal.
    Edit2: It seems the relevant file was /etc/bash.bashrc, and the solution was to simply remove rxvt-unicode from the if statement.
    Last edited by ptepid (2009-09-26 11:12:25)

    Okay, there's something else going on here. I just happened to be messing with ANSI escape codes for something else and the same issue arose.
    For instance
    [ptepid@securis ~]$ echo -e "Test1 \033[1;34m Test2 \033[0m"
    1;34m Test2 (~)Test1 Test2
    [ptepid@securis ~]$
    That echo statement should print "Test1 Test2" with test2 in blue (not shown here). It does that, but it's also spitting out the escape codes as garbage beforehand.
    Turns out only one user is affected. I'm trying to hunt down what is causing it, but I can't find any ENV variables that are different. It's only happening in X, but it's a problem with both rxvt and rxvt-unicode.
    SOLVED: Okay, now I feel pretty dumb. It was some bogus code in my .bashrc that was meant to update the titlebar of an xterm. That worked, but it also seems to mess with ANSI escape characters. This was the offending code:
    if [[ -n "$DISPLAY" ]]; then
    if [[ -n $MRXVT_TABTITLE ]]; then
    trap 'echo -ne "\e]61;${BASH_COMMAND//\"/} (${PWD/$HOME/~})\a"' DEBUG
    else
    trap 'echo -ne "\e]0;${BASH_COMMAND//\"/} (${PWD/$HOME/~})\a"' DEBUG
    fi
    fi
    A relic from when I'd used mrxvt.
    Last edited by ptepid (2009-09-26 11:11:55)

  • [SOLVED] Long prompt delay after issuing a command

    I use VirtualBox to run archlinux.
    When I issue a command, like ls in a directory with many files, the long outcome on the screen ends relatively fast (2-5 sec) but the command prompt is only available after 20-30 sec. In the meantime, processor is still in heavily use (95-100%). As soon as the prompt becomes again available the processor use drops to normal level.
    Does it have to do with virtualbox or ...?
    Thanks
    Last edited by barcher (2010-12-16 20:33:49)

    I run Arch Linux in Virtualbox and yes its does take up quite a bit of system resouces
    Depends on your system specs, amount of ram given over to VM etc...
    But to answer your question yes it does have a lot to do with Virtualbox.
    Arch would of course run very very fast in a real sytem enviroment
    Welcome to Arch :-)

  • [SOLVED] zsh start up issue

    When I open a new zsh session it is listing all aliases known to it.
    the only change is placing my aliases in a separate file & sourcing it in my ~/.zsrch
    even if I put the aliases back in the .zsrc file the same behaviour occurs.
    Is this trying to tell me I have syntax issue's or too many ???
    I only ask because it is just dumping them all to stdout upon startup (including ones I never knew I had!) without error & the aliases still work.
    here is what it looks like:
    ...='cd ../../'
    aur='pacaur -y'
    auri='pacaur -ii'
    aurs='pacaur -s'
    aurup='pacaur -u'
    aurupc='pacaur -k'
    config='git --git-dir=/home/t0m5k1/.arch-config.git/ --work-tree=/home/t0m5k1'
    cpuinfo=lscpu
    da='du -sch'
    dir='ls --color=auto --format=vertical'
    dnstop='sudo dnstop -l 5 eth1'
    egrep='egrep --color=auto'
    ethtool='sudo ethtool eth1'
    fgrep='fgrep --color=auto'
    grep='grep --color=auto'
    help-zshglob=H-Glob
    iftop='sudo iftop -i eth1'
    insecscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
    insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
    j='jobs -l'
    keep='noglob keep'
    l='ls -CF'
    la='ls -Al'
    lad='ls -d .*(/)'
    lc='ls -lcr'
    lh='ls -hAl --color=auto'
    lk='ls -lSr'
    ll='ls -l'
    lm='ls -al |more'
    lr='ls -lR'
    ls='ls -hF --color'
    lsa='ls -a .*(.)'
    lsbig='ls -flh *(.OL[1,10])'
    lsd='ls -d *(/)'
    lse='ls -d *(/^F)'
    lsl='ls -l *(@)'
    lsnew='ls -rtlh *(D.om[1,10])'
    lsnewdir='ls -rthdl *(/om[1,10]) .*(D/om[1,10])'
    lsold='ls -rtlh *(D.Om[1,10])'
    lsolddir='ls -rthdl *(/Om[1,10]) .*(D/Om[1,10])'
    lss='ls -l *(s,S,t)'
    lssmall='ls -Srl *(.oL[1,10])'
    lsw='ls -ld *(R,W,X.^ND/)'
    lsx='ls -l *(*)'
    lt='ls -ltr'
    lu='ls -lur'
    lx='ls -lXB'
    mdstat='cat /proc/mdstat'
    meminfo='free -m -l -t'
    new=modified
    nn=nano
    nocomment='sudo grep -Ev '\''\'\'\''^(#|$)'\''\'\'\'
    ns='sudo netstat -alnp --protocol=inet | less'
    pac='sudo pacman -S'
    pacc='sudo pacman -Sc'
    pacf='sudo pacman -Ql'
    paci='sudo pacman -Sii'
    pacl='sudo pacman -Sl'
    pacld='sudo pacman -Qi'
    pacll='sudo pacman -Qqm'
    paclo='sudo pacman -Qdt'
    pacm='sudo makepkg -fci'
    paco='sudo pacman -Qo'
    pacp='sudo pacman -Rns'
    pacr='sudo pacman -Rs'
    pacs='sudo pacman -Ss'
    pacu='sudo pacman -Syu'
    ports='sudo netstat -nape --inet | less'
    poweroff='sudo power off'
    pscpu='ps auxf | sort -nr -k 3'
    pscpu10='ps auxf | sort -nr -k 3 | head -10'
    psmem='ps auxf | sort -nr -k 4'
    psmem10='ps auxf | sort -nr -k 4 | head -10'
    reboot='sudo reboot'
    rmcdir='cd ..; rmdir $OLDPWD || cd $OLDPWD'
    root='sudo sudo -s'
    scat='sudo cat'
    screen='/usr/bin/screen -c /home/t0m5k1/.screenrc'
    se=simple-extract
    sless='sudo less'
    snan='sudo nano'
    svim='sudo vim'
    tcpdump='sudo tcpdump -i eth1'
    term2iso='echo '\''Setting terminal to iso mode'\'' ; print -n '\''\e%@'\'
    term2utf='echo '\''Setting terminal to utf-8 mode'\''; print -n '\''\e%G'\'
    tree='tree -Csu'
    url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magic'
    vdir='ls --color=auto --format=long'
    vi=vim
    vnstat='sudo vnstat -i eth1'
    which-command=whence
    ┌─(t0m5k1@b0x)-(2065/pts/0)-(04:13pm:16/07/13)-
    └─>(%:~)
    └─>>
    I see this in a new window or even if I start zsh from a bash session.
    any clues here
    ADDITIONAL INFO:
    packages used relating to ZSH:
    extra/grml-zsh-config 0.8.2-1 [installed]
    grml's zsh setup
    extra/zsh 5.0.2-2 [installed]
    A very advanced and programmable command interpreter (shell) for UNIX
    community/zsh-lovers 0.8.3-2 [installed]
    A collection of tips, tricks and examples for the Z shell.
    Config files:
    my .zsrc & alias file
    http://sprunge.us/YAQR
    unedited /etc/zsh/zshrc
    http://sprunge.us/IOJY
    Last edited by t0m5k1 (2013-07-16 15:50:58)

    Trilby wrote: Given that there seems to be *several* hundred lines there (do you use all that?)
    lol yea got fed up with searching my history!
    Trilby wrote: rename/move the configs, and restart zsh - is the problem gone?  If so, start adding things back little by little: add back the first half of the config, is the problem still there?  etc, etc.
    yup just decided to do that & have found 2 possible issue's
    1) changed all " for ' to follow the same syntax as /etc/zsh/zshrc
    2) found a blank alias so removed it
    all working thanks trilby for pointers/logic & wonderwoofy for pointing out the lack of info

Maybe you are looking for

  • ITunes not installing because of VBScript error?

    Every time I tried to install iTunes on my computer, it opens windows installer and then gives an error message stating that "iTunes cannot be installed because Visual Basic Script (VBScript) is not installed or has been disabled." What can I do abou

  • Problem with youtube videos

    Hello, Mac book air 13, OSX10.9.2, flash player updated: I can't read youtube videos. They don't begin, the page is ok but the reading doesn't begin.  In the past it was working without problem, I don't understand what happened? I don't know what to

  • Sequence match / 1080i50 or 25f

    Howdy, Can anyone help and give some clue asto why this happens and if I have the wrong sequence setting for this edit. I shot some footage with a canon xh-a1 in 25f. The clip is imported info fcp 6 as HDV and put on a 1080i50 timeline with sequence

  • How to test Barcode Functionality in siebel

    Hi Experts, We need to read input from a Bar code and store the data in the field in a Business Component. From the bookshelf we found that bar code reader need to transmit the bar code with prefix as "Ctrl - \" and suffix as "Ctrl - /". My question

  • Few questions about Mobile ES2

    1. Cannot find a suitable client for LiveCycle ES2.. Does ADEP client backward compatible? 2. Does the mobile device require Adobe AIR to succesfully install/use the mobile client? 3. Mobile Guide render service renders the XDP to mobile devices. Wil