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

Re: %? glob hack



On Dec 5,  8:46am, Mikael Magnusson wrote:
} Subject: %? glob hack
}
} ... If someone really uses [ %? ] a lot and is bothered by having
} to quote the ?, they could just alias fg/bg to noglob fg/bg, or use
} whatever the bash-esque option to keep failed globs is called. Or am I
} missing something here?

What you're missing is that you can use history search syntax in command
name position, i.e. without any fg/bg in front of it to which to attach
the "noglob" alias.

That is, if "torch$ " is my prompt,

torch$ %?Src

will search for a job with "Src" in it and bring it to the foreground.

It's true this was used a lot more often before there was a key binding
for history-search-backward (and by people moving to zsh from csh, of
which there is a steadily decreasing supply).

On the other point: Just because you want %?string to work for history
search does not mean you want nonomatch behavior on other globs.



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