You are not logged in.
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)
Offline
Have you tried to take out your prompt components one by one, each time testing it?
You might find your problem just like that.
That's what I did to resolve my zsh problems in the past.
Offline
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)
Offline
Actually, that can't be right. In the picture above, both problems occur, but I've only put colours in the right-hand prompt.
Still, the problem goes away when I remove the colours, and occurs when I add them again.
Offline
How do you insert the color references? You need to surround those with escapes so the prompt doesn't count them as characters, like this:
%{color-reference-here%}prompt-element-here
Last edited by VCoolio (2012-02-16 22:43:36)
Offline
Ahh, a great many thanks to you, good sir.
The arch wiki states that using %{%} is "usefull", so I didn't realize how much it really did.
That solved it, thanks again
EDIT: How do I mark the thread as solved?
Last edited by Bladtman242 (2012-02-17 12:07:18)
Offline
How do I mark the thread as solved?
Edit your first post in the thread. You'll be able to edit the subject line too.
Offline
Thanks
Offline
The arch wiki states that using %{%} is "usefull", so I didn't realize how much it really did.
Just wanted to suggest: If the wiki wasn't clear, improve it
Offline
Good point.
I actually just registered a user there earlier today, so now I will!
Last edited by Bladtman242 (2012-02-17 21:28:22)
Offline