BTS

Issue286

Title zsh: d cmd doesn't work anymore
Priority bug Status resolved
Superseder Nosy List ft, gebi, mika
Assigned To ft Topics

Created on 2007-09-13.09:44:42 by gebi, last changed 2007-09-13.13:35:06 by gebi.

Messages
msg790 (view) Author: gebi Date: 2007-09-13.13:35:06
in /etc/zsh/zshrc.local
alias d='dirs -v'

after that a function d is loaded in ~/.zshrc (d function from nikolai)

but how is this able to create a loop?
msg789 (view) Author: mika Date: 2007-09-13.12:43:22
* Michael Gebetsroither <bts@bts.grml.org> [20070913 13:32]:

> % which d
> d: aliased to dirs -v

Huh?!

# jump between directories
# Copyright 2005 Nikolai Weibull <nikolai@bitwi.se>
# notice: option AUTO_PUSHD has to be set
  #f5# Jump between directories
  d(){
    emulate -L zsh
    autoload -U colors
    local color=$fg_bold[blue]
    integer i=0
    dirs -p | while read dir; do
      local num="${$(printf "%-4d " $i)/ /.}"
      printf " %s  $color%s$reset_color\n" $num $dir
      (( i++ ))
    done
    integer dir=-1
    read -r 'dir?Jump to directory: ' || return
    (( dir == -1 )) && return
    if (( dir < 0 || dir >= i )); then
      echo d: no such directory stack entry: $dir
      return 1
    fi
    cd ~$dir
  }

-> Are you sure you don't have that stuff inside your personal
configuration (outside of grml's zsh configuration) - overriding
grml's d()-function?

regards,
-mika-
msg788 (view) Author: gebi Date: 2007-09-13.11:32:38
% which d
d: aliased to dirs -v

ii  grml-etc                    1.0.16
ii  grml-etc-core               0.3.23
msg787 (view) Author: mika Date: 2007-09-13.09:48:30
Gebi, what's the output of 'which d' (because it works for me)?
Which grml-version are you talking about?
msg786 (view) Author: gebi Date: 2007-09-13.09:44:42
d should print the dirstack, but in recent grml versions didn't work anymore.

% d
dirs:5: maximum nested function level reached
Jump to directory:
History
Date User Action Args
2007-09-13 13:35:06gebisetstatus: chatting -> resolved
nosy: mika, gebi, ft
messages: + msg790
2007-09-13 12:43:23mikasetnosy: mika, gebi, ft
messages: + msg789
2007-09-13 11:32:38gebisetnosy: mika, gebi, ft
messages: + msg788
2007-09-13 09:48:30mikasetstatus: unread -> chatting
nosy: + mika
messages: + msg787
2007-09-13 09:44:42gebicreate