Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug report: segfault when pasting (function and alias names collide)



I think this may already have been reported in 2010:
https://www.zsh.org/mla/workers/2010/msg00521.html
but it does not seem to be fixed.
The solution is simple enough, but in my case it was triggered whenever I
pasted something
in the Terminal, so it was rather difficult to find the cause.

I defined a function 'h' (in my .zshrc):

    h() {
      pattern="$1"
      if [[ -z "$pattern" ]]; then
        fc -n -l 1
      else
        if [[ $pattern =~ '[*]' ]]; then
          fc -n -l -m "${pattern}" 1
        else
          fc -n -l -m "*${pattern}*" 1
        fi
      fi
    }

without unaliasing 'h' before (which is defined in the 'history' plugin of
oh-my-zsh).

    alias h='history'

If the redefinition is problematic, would it be possible to trigger an
error, when the function
is defined? A segfault when pasting seems to be quite bad.


Environment:
  OS X 10.12.2
  iTerm 2 (3.0.13)
  zsh 5.3.1 (x86_64-apple-darwin16.3.0) # via homebrew


Messages sorted by: Reverse Date, Date, Thread, Author