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

Re: zsh-4.04 and w3m browser



On Aug 28,  6:56pm, Peter Stephenson wrote:
> Subject: Re: zsh-4.04 and w3m browser
> Wayne Davison wrote:
> > 
> > If there were some way to run a shell function after the user hits
> > return but before the line is parsed, it would be possible for the
> > function to add single quotes
> 
> I've never dared add this because it's too easy to get the shell into a
> state where it will never work again.

What about a command-not-found hook of some kind?  E.g. any time you get
command-not-found, run function X with the command line as $@.  The only
rule would be that if you get command-not-found again while inside the
command-not-found hook, the hook is not called again.

Then one could do something like

realpath=($path)
path=()
setopt noglob
function command_not_found_hook {
  local -ah path
  path=($realpath)
  setopt localoptions glob
  urlglobber "$@"
}



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