BTS

Message1324

Author ft
Recipients SkinnerRobot, mika
Date 2008-05-25.09:51:01
Content
Michael Prokop <mika@grml.org>:
> * Frank Terbeck [20080407 14:42]:
> > Michael Prokop:
[...]
> > > Frank, any ideas how we could "work around" this issue?
[...]
> > We could create a binding, that would toggle these abbreviations on
> > and off. Or we could introduce a variable $DISABLE_ABBREV.
> 
> > Neither of these solutions is exceptionally nice.
> > I'll think about it...
> 
> ACK
> 
[...]
> [...] Maybe $NOPOWERCOMP or something like that (our "disable
> environment variables" usually start with $NO... :)) really might be
> the best option?

Hm, thinking about it:

To *really* make sure pasting stuff into the command line does not
trigger abbreviation, we won't get around disabling it, IMHO.

There would be, if we could tell the rate at which characters are
typed into the shell (much like irssi detects pasting). However, I
think it absolutely *not* justified to check timestamps for every
character ever entered (let alone the fact, that I don't know of a way
to get timestamps with higher resolution than whole seconds - which
would obviously be needed here).

Coming back to some seriousness about the subject:

    a) introduce $NOABBREVIATION (defaulting to 0).
    b) create a binding (e.g.: ^xA) that toggles the use of
       abbreviations on and off.

If $NOABBREVIATION it greater than 0, disable abbreviations by default
(while still being able to re-enable them with the binding).

If $NOABBREVIATION is at 0 (its default), everything should work as it
does now. If the user wants to paste something, and something goes
wrong because an abbreviation is triggered, he/she can disable
abbreviations temporarily by hitting the binding.


This is the best I can think of right now.
Implementation? Well, If at all, I can only do it this evening. And
only if I get my work done until then. Else, it will have to wait
another week or two - unless someone else does it (which in fact is
easily possible, because no black-zsh-magic would be needed at all;
I'm also willing to review code other produce on the subject).

Regards, Frank

PS: I am interested in an elegant way to detect pastes into the shell.
    So if someone has got an idea, I'm all ears. :-)

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925
History
Date User Action Args
2008-05-25 09:51:02ftsetrecipients: + SkinnerRobot
2008-05-25 09:51:02ftlinkissue445 messages
2008-05-25 09:51:01ftcreate