zsh-workers
 help / color / mirror / code / Atom feed
* Bug report: segfault when pasting (function and alias names collide)
@ 2017-01-05 16:21 Victor Volle
  2017-01-06  2:29 ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: Victor Volle @ 2017-01-05 16:21 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-07  1:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-05 16:21 Bug report: segfault when pasting (function and alias names collide) Victor Volle
2017-01-06  2:29 ` Daniel Shahaf
2017-01-06 12:26   ` Victor Volle
2017-01-06 16:21     ` Daniel Shahaf
2017-01-06 18:56       ` Victor Volle
2017-01-06 16:40   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).