You are not logged in.

#1 2011-09-07 07:42:55

dodo3773
Member
Registered: 2011-03-17
Posts: 818

[SOLVED] cd to directory with spaces zsh

When I try to cd to directory with spaces zsh I get an error:

cd:cd:6: string not in pwd: 

Here is my .zshrc

# Auto Completion And Additional Settings
autoload -U compinit
compinit
zstyle ':completion:*' menu select
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
eval `dircolors -b`

setopt autopushd pushdminus pushdsilent pushdtohome
setopt autocd
setopt cdablevars
setopt ignoreeof
setopt interactivecomments
setopt nobanghist
setopt noclobber
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
setopt SH_WORD_SPLIT
setopt nohup
setopt completealiases

setopt correctall

#Colored Prompt
autoload -U promptinit
promptinit

#Colors
autoload -U colors && colors

# allow approximate
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
#zstyle ':completion:*' special-dirs true


# tab completion for PID :D
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always

#compdef _gnu_generic 
#zstyle ':completion:*:processes-names' command  'ps c -u ${USER} -o command | uniq'


compdef _pids cpulimit


compdef _pids ps
compdef _pids appuptime

# cd not select parent dir
zstyle ':completion:*:cd:*' ignore-parents parent pwd

#Special Keys
typeset -g -A key
bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char 
# completion in the middle of a line
bindkey '^i' expand-or-complete-prefix

#Directory Colors
LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:';
export LS_COLORS

#History Search
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward

#Aliases
alias -s txt=$EDITOR
alias -s conf=$EDITOR
#alias -s zshrc=$EDITOR
#alias -s bashrc=$EDITOR

alias -s png=eog
alias -s jpg=eog
alias -s gif=eog
alias -s svg=eog
alias cpulimit='sudo cpulimit -l 60 -p'
alias wiki='firefox /usr/share/doc/arch-wiki/html/index.html'
alias appuptime='/home/dodo3773/Documents/Scripts/appuptime.sh'


#Moved From Bash
#CLI editor 
export EDITOR="nano"

#Update System

alias update='sudo pacman-color -Syu && yaourt -Su --aur'


# dvdauthor
export VIDEO_FORMAT=NTSC

## Aliases

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls --color=auto'


alias sudo='sudo '
alias pacman='pacman-color'

alias tcpkill='sudo tcpkill -i wlan0'

alias hist="fc -l 1 55000 | grep "

alias vim="/usr/bin/vim"

alias grepmod='lsmod | grep'  

alias peggle='padsp wine /home/dodo3773/Games/PopCap/pegglenights/PeggleNights/PeggleNights.exe'

#Colorize Man Pages

export LESS_TERMCAP_mb=$'\E[01;31m'      # begin blinking
export LESS_TERMCAP_md=$'\E[01;31m'      # begin bold
export LESS_TERMCAP_me=$'\E[0m'          # end mode
export LESS_TERMCAP_se=$'\E[0m'          # end standout-mode                 
export LESS_TERMCAP_so=$'\E[01;44;33m'   # begin standout-mode - info box                              
export LESS_TERMCAP_ue=$'\E[0m'          # end underline
export LESS_TERMCAP_us=$'\E[01;32m'      # begin underline


#Del send to trash
alias del='mv -t ~/.local/share/Trash/files'


### FUNCTIONS

# Easy extract
extract () {
  if [ -f $1 ] ; then
      case $1 in
          *.tar.bz2)   tar xvjf $1    ;;
          *.tar.gz)    tar xvzf $1    ;;
          *.bz2)       bunzip2 $1     ;;
          *.rar)       rar x $1       ;;
          *.gz)        gunzip $1      ;;
	  *.jar)       jar xf $1      ;;   	
          *.tar)       tar xvf $1     ;;
          *.tbz2)      tar xvjf $1    ;;
          *.tgz)       tar xvzf $1    ;;
          *.zip)       unzip $1       ;;
          *.Z)         uncompress $1  ;;
          *.7z)        7z x $1        ;;
          *)           echo "don't know how to extract '$1'..." ;;
      esac
  else
      echo "'$1' is not a valid file!"
  fi
}


#List All Available Commands
function lac
{
    echo -n $PATH | xargs -d : -I {} find {} -maxdepth 1 \
        -executable -type f -printf '%P\n' | sort -u
}

function lac
{
    COMMANDS=`echo -n $PATH | xargs -d : -I {} find {} -maxdepth 1 \
        -executable -type f -printf '%P\n'`
    ALIASES=`alias | cut -d '=' -f 1`
    echo "$COMMANDS"$'\n'"$ALIASES" | sort -u
}



#Custom Terminal
#PROMPT="%* %~$ "
PS1="%{%F{green}%}%* %{%f%}%{%F{white}%}%~ %{%F{green}%}>> %{%f%}"
#Syntax Highlighting
source /home/dodo3773/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Has anyone else came across this? Is there something wrong with my zshrc?

Edit: "chdir" still works. I guess I could use an alias.

Last edited by dodo3773 (2011-09-07 08:54:30)

Offline

#2 2011-09-07 08:29:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] cd to directory with spaces zsh

How do you try to cd?

black% mkdir "some spaces"
black% cd "some spaces"
black% pwd
/home/karol/test/some spaces

;P

Offline

#3 2011-09-07 08:33:10

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: [SOLVED] cd to directory with spaces zsh

karol wrote:

How do you try to cd?

black% mkdir "some spaces"
black% cd "some spaces"
black% pwd
/home/karol/test/some spaces

;P

Here is what I get:

    >> mkdir "some spaces"
    >> cd "some spaces"
cd:cd:6: string not in pwd: some

Offline

#4 2011-09-07 08:36:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] cd to directory with spaces zsh

I've just installed zsh and did some minimal config and cd works, so try commenting out your config one by one until you find the culprit ... or wait for somebody who actually knows something about zsh :-)

[karol@black ~]$ cat .zshrc 
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/karol/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

Edit:

# cd not select parent dir
zstyle ':completion:*:cd:*' ignore-parents parent pwd

What does it do?

Edit 2: I can cd just fine using your config. (should have tried it earlier ...) The only difference is I'm not using the syntax highlighting

source /home/dodo3773/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

because the path doesn't exist on my computer.

Last edited by karol (2011-09-07 08:43:15)

Offline

#5 2011-09-07 08:46:11

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: [SOLVED] cd to directory with spaces zsh

karol wrote:

Edit 2: I can cd just fine using your config. (should have tried it earlier ...)


Thank you for testing my config. I took your direction and just deleted my .zshrc and now cd works. So, it must be a misconfiguration somewhere. I will test one by one and post back when I figure it out.

Edit: I thought of the syntax highlighting. That was not it.

Last edited by dodo3773 (2011-09-07 08:46:58)

Offline

#6 2011-09-07 08:48:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] cd to directory with spaces zsh

I can use tab-completion too jsut fine.
Try commenting out the last line - syntax-highlighting - as I don't use it.

Last edited by karol (2011-09-07 08:49:12)

Offline

#7 2011-09-07 08:54:00

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: [SOLVED] cd to directory with spaces zsh

karol wrote:

I can use tab-completion too jsut fine.
Try commenting out the last line - syntax-highlighting - as I don't use it.

It was

setopt SH_WORD_SPLIT

Not even sure where I got that one. Must have been a copy paste job. Thanks again.

Apparently it has something to do with sh and ksh compatibility.

Last edited by dodo3773 (2011-09-07 08:59:30)

Offline

Board footer

Powered by FluxBB