You are not logged in.

#1 2013-06-08 08:37:46

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Zsh compinit:375: parse error near ‘(’

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)(*)=(*) ]]; then

I haven't modified the file in any way.

Compinit is loaded from my ~/.zshrc as follows:

autoload -U compinit && compinit

Help, please?

Offline

#2 2013-06-13 21:14:13

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

Bump, please?

Offline

#3 2013-06-13 21:24:47

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Zsh compinit:375: parse error near ‘(’

Post your entire ~/.zshrc


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#4 2013-06-13 21:31:19

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

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

#5 2013-06-17 22:17:13

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

Bump, please.

Offline

#6 2013-06-17 22:19:49

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Zsh compinit:375: parse error near ‘(’

Please see here.

Offline

#7 2013-06-17 22:26:57

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

I am sorry. Thank you for explaining rather than yelling.

Offline

#8 2013-10-15 08:08:17

pogojotz
Member
Registered: 2011-06-29
Posts: 10

Re: Zsh compinit:375: parse error near ‘(’

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

#9 2013-10-16 18:47:37

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

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

#10 2013-10-17 07:32:56

pogojotz
Member
Registered: 2011-06-29
Posts: 10

Re: Zsh compinit:375: parse error near ‘(’

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

#11 2013-10-20 18:43:29

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

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

#12 2013-10-20 19:30:53

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Zsh compinit:375: parse error near ‘(’

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

#13 2013-10-22 21:18:06

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: Zsh compinit:375: parse error near ‘(’

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 hmm

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

Board footer

Powered by FluxBB