You are not logged in.
Hello,
I've just installed Zsh, and it crashes on login with the following error:
compinit:375: parse error near ‘(’repeated three times. The appropriate line in /usr/share/zsh/functions/Completion/compinit is this:
if [[ $1 = (#b)(*)=(*) ]]; thenI haven't modified the file in any way.
Compinit is loaded from my ~/.zshrc as follows:
autoload -U compinit && compinitHelp, please?
Offline
Bump, please?
Offline
Here it is. Generally, it's based on the advice in the wiki.
# BEHAVIOUR =============================================================================
# don't know
autoload p
typeset -A key
zstyle :compinstall filename '/home/kamil/.zshrc'
# autojump
. /etc/profile
. /etc/profile.d/autojump.zsh
# autoloads
autoload -U colors && colors
autoload -U compinit && compinit
autoload -U promptinit && promptinit
# history
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# keys
stty -ixon -ixoff # free ctrl-s for use in Vim
bindkey -e # emacs mode
key[End]=${terminfo[kend]}
key[Home]=${terminfo[khome]}
key[Down]=${terminfo[kcud1]}
key[Up]=${terminfo[kcuu1]}
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" history-beginning-search-forward
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" history-beginning-search-backward
bindkey ';5D' backward-word # ctrl-left
bindkey ';5C' forward-word # ctrl-right
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () { printf '%s' "${terminfo[smkx]}" }
function zle-line-finish () { printf '%s' "${terminfo[rmkx]}" }
zle -N zle-line-init
zle -N zle-line-finish
fi
# prompt
PROMPT="
%~ %{$fg[green]%}%# %{$reset_color%}"
RPROMPT="%?"
# setopts
setopt extendedGlob
setopt hist_ignore_dups
setopt interactivecomments
setopt noflowcontrol
### ALIASES =============================================================================
alias dzen='dzen2 -bg $colBgNormal -fg $colFgNormal '
alias pacman='sudo pacman'
alias cal='cal -m' # -m: monday's the first day
alias cp='cp -iv' # -i: ask before overwriting; -v: verbose
alias emacs='emacs -nw' # the terminal version
alias grep='grep --color=auto -in' # -i: case-insensitive; -n: line numbers
alias locate='locate -i' # -i: case-insensitive
alias ls='ls --color=auto -C' # -C: columns
alias mv='mv -iv' # -i: ask before overwriting; -v: verbose
alias nano='nano -c' # -c: line numbers
alias open='gnome-open'
alias pf='ps -o user,pid,ppid,command -ax | grep'
alias rm="rm -iv" # silly, silly me
alias updatedb='sudo updatedb'
alias vim="vim -p" # open multiple files in tabs
alias wifi-scan='sudo iwlist wlan0 scanning | /bin/grep "Cell\|Quality\|Encryption\|ESSID"'
### DEFAULTS ============================================================================
export BROWSER=/usr/bin/chromium
export EDITOR=/usr/bin/vim
export PAGER=/usr/bin/vimpager && alias less=$PAGER
export TERM='xterm-256color'
# java a tiny bit less annoying
# export _JAVA_OPTIONS="-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"Offline
Bump, please.
Offline
Please see here.
Offline
I am sorry. Thank you for explaining rather than yelling.
Offline
hi! probably it's a little late, but you didn't mark as solved...
i had the exact same error. turned out that i shouldn't have issued
emulate sh before sourcing my .zshrc...
May be you have that command in one of the scripts you are sourcing in the .zshrc like /etc/profile, /etc/profile.d/autojump.zsh ?
Hope that helps!
Offline
It's not late at all. I still haven't managed to solve it, and I've given up trying to. Unfortunately, it must be something else in my case because I don't seem to have 'emulate sh' anywhere in my .zshrc or any of the files sourced from it. But thanks a lot for trying! I appreciate that you took the time to find and revive such an old thread, thanks a lot!
Offline
I just came to this thread on the google path, when I had the same error message...
also have a look into
~/.zshenv
~/.zprofile
/etc/zsh/zprofile
~/.zlogin
May be the command is there somewhere...
Offline
Thank you! I found the command in /etc/zsh/zprofile and commenting it out did indeed seem to help, but it broke Unicode in gnome-terminal… I will have to look into it one day, and post the solution here if I can find any. Anyway, thanks for the involvement.
Offline
That single line in /etc/zsh/zprofile in kind of important. It sources /etc/profile in order to set up a sane environment for your shell. This includes setting a sane PATH as well as sourcing the things in /etc/profile.d (at least the *.sh files). It is not a surprise that commenting this line out has broken things.
Edit: Looking at your zshrc posted above, you might be having those problems because you are sourcing /etc/profile without emulating sh. Since /etc/profile is already sourced by /etc/zsh/zprofile (or at least it was before you commented it out), it is probably entirely unnecessary to resource that. Sourcing /etc/profile.d/autojump.zsh is probably a bit more sane, but also might be unnecessary since /etc/profile already sources /etc/profile.d/autojump.sh (in sh emulation mode).
Last edited by WonderWoofy (2013-10-20 19:35:45)
Offline
Hm. It seems then, that I can either emulate sh and source /etc/profile in my /etc/zsh/zprofile, and keep getting the parse error, or not have Unicode in the terminal. In this case, I'm going to have to go with the error ![]()
You are right about resourcing /etc/profile in ~/.zshrc. Commenting it out doesn't seem to change anything. Commenting out autojump. however, breaks it, so I'll leave this one as is. Apparently, something happens between /etc/zsh/zprofile and ~/.zshrc that somehow removes `j' from the available commands.
Thanks for the comments!
Offline