Hi, I don't know if this is the correct mailing list to use, but I noticed that I was unable to use the ctrl+s in any keybindings for sticky-note (in functions/Misc/). I like to bind ctrl+x ctrl+s (^X^S) to accept-line to stay consistent with emacs. 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. Cheers, Joe.
On Sat, Nov 14, 2020 at 3:06 PM vapnik spaknik <vapniks@yahoo.com> 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 local STICKYFILE=${STICKYFILE:-$HOME/.zsticky}
On Sun, 2020-11-15 at 11:44 -0800, Bart Schaefer wrote:
> 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?
That does make a lot of sense. It's definitely not syntactic or
emulation, so it's hard to see why messing it about here is a good idea.
Unless there's a counterexample (which there usually is), this could
be considered a bug.
pws
[-- Attachment #1: Type: text/plain, Size: 730 bytes --] >On Sunday, November 15, 2020, 07:45:06 PM GMT, Bart Schaefer <schaefer@brasslantern.com> wrote: >>On Sat, Nov 14, 2020 at 3:06 PM vapnik spaknik <vapniks@yahoo.com> wrote: >>> 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. Are you sure about that? In the documentation for emulate it says: "If the -L switch is given, the options LOCAL_OPTIONS, LOCAL_PATTERNS and LOCAL_TRAPS will be set as well, causing the effects of the emulate command and any setopt, disable -p or enable -p, and trap commands to be local to the immediately surrounding shell function, if any" [-- Attachment #2: Type: text/html, Size: 863 bytes --]
On 11/16/20, vapnik spaknik <vapniks@yahoo.com> wrote:
>
>
>>On Sunday, November 15, 2020, 07:45:06 PM GMT, Bart Schaefer
>> <schaefer@brasslantern.com> wrote:
>
>>>On Sat, Nov 14, 2020 at 3:06 PM vapnik spaknik <vapniks@yahoo.com> wrote:
>>>> 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.
>
> Are you sure about that? In the documentation for emulate it says: "If the
> -L switch is given, the options LOCAL_OPTIONS, LOCAL_PATTERNS and
> LOCAL_TRAPS will be set as well, causing the effects of the emulate command
> and any setopt, disable -p or enable -p, and trap commands to be local to
> the immediately surrounding shell function, if any"
They would lose it while using this function.
--
Mikael Magnusson