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

Re: (temporary) disable bracketed_paste



On May 5,  7:55pm, Piotr Karbowski wrote:
} 
} I'd like to know how to temporary disable zle_bracketed_paste. Best 
} would be if I could disable it for a moment, and restore afterward.
[...]
} I tried to `unset zle_bracketed_paste` but it does work only on the root 
} of .zshrc, if I wrap it within function, it does not do a thing.

zle_bracketed_paste is used when ZLE begins and when ZLE ends, because
it has to be in effect before any paste action occurs.

The value of $zle_bracketed_paste is an array containing the on/off
controls for the feature.  So all you need is for example

    print -nr ${zle_bracketed_paste[2]} >/dev/tty  # Toggle off
    {
      #
      # Do whatever it is you need to do
      #
    } always {
      print -nr ${zle_bracketed_paste[1]} >/dev/tty  # Toggle on
    }

The "always" is just for sanity in case of early exit from whatever it
is you need to do.



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