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

Re: quick bugfix for sticky-note

On Sat, Nov 14, 2020 at 3:06 PM vapnik spaknik <vapniks@xxxxxxxxx> wrote:
> The problem is that sticky-note resets all options which means that flowcontrol is enabled and so pressing ctrl+s overrides any keybindings and stops output. I can't see any reason for needing this behaviour, so a quick fix would be to just add 'noflowcontrol' to the 'setopt' line near the start of the function.

Hm.  The problem with that is that people who want flow control
suddenly lose it.

The doc for "emulate" says:
     If the -R switch is given, all settable options are reset to their
     default value corresponding to the specified emulation mode, except
     for certain options describing the interactive environment;

I wonder if flowcontrol should be considered an option "describing the
interactive environment" and therefore should not be reset by "emulate
-R".  That would be a change to long-standing behavior, of course, but
is there an obvious case where it would really matter?

In the meantime, this (apologies for any gmail word-wrapping):

diff --git a/Functions/Misc/sticky-note b/Functions/Misc/sticky-note
index efe5ec1eb..dd31eb81f 100644
--- a/Functions/Misc/sticky-note
+++ b/Functions/Misc/sticky-note
@@ -48,7 +48,7 @@

 # I encourage all you creative people to contribute enhancements ...

-emulate -LR zsh
+emulate -LR zsh -o ${${options[flowcontrol]/off/no}/on/}flowcontrol
 setopt nobanghist extendedhistory histignoredups


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