From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13979 invoked by alias); 13 Dec 2016 19:35:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22216 Received: (qmail 28601 invoked from network); 13 Dec 2016 19:35:52 -0000 X-Qmail-Scanner-Diagnostics: from mailout2.lrz.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(129.187.255.136):SA:0(-2.3/5.0):. Processed in 1.740694 secs); 13 Dec 2016 19:35:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: zsh.Andy@spiegl.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at spiegl.de does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at lrz.de in lxmhs66.srv.lrz.de Date: Tue, 13 Dec 2016 20:29:41 +0100 From: Andy Spiegl To: zsh-users@zsh.org Subject: Re: Howto to print ENTER to zle-buffer? Message-ID: <20161213192941.z3foaju5gslyeqse@spiegl.de> Mail-Followup-To: zsh-users@zsh.org References: <20161213150101.lgcl6r44gc5b4sia@spiegl.de> <161213081230.ZM21776@torch.brasslantern.com> <20161213164749.5gfrgorfe2ad4edr@spiegl.de> <161213093008.ZM22110@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <161213093008.ZM22110@torch.brasslantern.com> X-gpg-key: ID C2CB30F0, available on friendly keyservers near you X-gpg-fingerprint: 9051 50B9 13B0 57B9 10FD 48AC 4FA1 209B C2CB 30F0 X-Accepted-File-Formats: ASCII PDF Open/Free Formats - NO proprietory (e.g. Microsoft) files, please X-how-to-quote: http://quoting.is-easy.de/ X-how-to-ask-questions: http://www.catb.org/~esr/faqs/smart-questions.html X-stupid-disclaimers: http://goldmark.org/jeff/stupid-disclaimers/ X-angstklauseln: http://www.heise.de/artikel-archiv/ct/2014/08/136_Angstklauseln User-Agent: Mutt/1.6.2-neo (2016-08-21) > Usually better if you say stuff like this up front, it helps to have > context when trying to answer a question! You are right, sorry. I had thought about it but then didn't want to clutter up my (presumably) simple question with too much side information. > Given this -- and assuming you can target zsh-5.3 -- I'd go with: I'm still stuck with 5.2. Guess I have to wait a while then. :-( > autoload -Uz add-zle-hook-widget > session-startup { > command-to-run args # your thing here > add-zle-hook-widget -d line-init $WIDGET > } > add-zle-hook-widget line-init session-startup Looks very smart but I'm not sure I understand how this works. You define the function "session-startup" which is then hooked to zle such that it is run after initialization? How does it show up in the zle buffer then? No "print -z" anymore? Thanks! Andy