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

Re: Is there any possible way to automatically escape characters when executing an alias in zsh?



On Sat, Sep 11, 2021 at 11:41 AM Steve Dondley <s@xxxxxxxxxxx> wrote:
>
> tasn call Tom's friend
>
> This will thrown an error unless I escape the apostrophe.

Sorry, why does this produce an error?

% tasn call Tom's friend
quote>

Do you use setopt cshjunkiequotes ?

> I don't want to turn these into functions because then I lose the
> autocomplete capabilities.

Turning them into functions wouldn't help with quote parsing anyway.

On Sat, Sep 11, 2021 at 3:39 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>
> This is fun and all, but it's not clear to me why this is desirable
> over, say:
>
>     % tasn "call Tom's friend"

PWS's solution is also going to produce this result:

% tasn call 'double "quotes" here'
tasn call \'double "quotes" here\'

which is probably not the desired effect?

Figuring out which quotes mean something and which ought to be
re-quoted is not a trivial matter.




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