From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11202 invoked by alias); 27 Jul 2013 16:20:49 -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: 17895 Received: (qmail 26664 invoked from network); 27 Jul 2013 16:20:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.48 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=1DjiBt4+HebnhzUBhggOTC61QPaJ/Bh2pHOKziWtSV8=; b=CditdxVW0DTDIORFvfsVGn0LKFKEOVJiFUeOwCeJBsPbV/CmDyKcn2060z3hsyydEf QMPywLnspu+/cRI7LTkBZTnB+jvryEp6/VlQwKH5FDf7jbddU+BsejhF83hyc88X2fQ3 UEcuIKe/nWkaHnSMHEhAzww2/SzIlQQaq2wDQHdHSZDZZS6ex4GUvGdkSbVywWxXOjbX BxeIxLWQayG+DhPPV+bVSwiZArBqSDHwiUphEkgMEK0kuJ52WLwpHDuCqbeDsHj/MO8A RiteqqhU08zOj18UmNTGmJnviME93auOwmpeSbfBO/KxUWS7fKENRygiB2S8hFXLXYnt 4uRg== X-Received: by 10.180.187.209 with SMTP id fu17mr2280337wic.52.1374942025350; Sat, 27 Jul 2013 09:20:25 -0700 (PDT) Date: Sat, 27 Jul 2013 17:20:22 +0100 From: Stephane Chazelas To: Frank Terbeck Cc: zsh-users@zsh.org Subject: Re: print to the terminal in zle Message-ID: <20130727162022.GA14201@chaz.gmail.com> Mail-Followup-To: Frank Terbeck , zsh-users@zsh.org References: <20130726134811.GA14136@chaz.gmail.com> <87siz1gr4h.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87siz1gr4h.fsf@ft.bewatermyfriend.org> User-Agent: Mutt/1.5.21 (2010-09-15) 2013-07-26 19:36:46 +0200, Frank Terbeck: > Hey Stephane, > > Stephane Chazelas wrote: > > recently, Debian broke some of my scripts using ZLE in `zsh -i` by adding: > > An interactive shell for a script? What's the reason for that? See http://www.zsh.org/mla/users/2007/msg01187.html The idea is just to use the zsh line editor in an application of mine (there a wrapper around mairix (a mail indexer) to provide with an intelligent prompt (with completion) for mutt). > > > function zle-line-init () { > > emulate -L zsh > > printf '%s' ${terminfo[smkx]} > > } > > > > To /etc/zsh/zshrc > > > > That smkx escape sequence is printed to stdout instead of the terminal. > > Which terminal is that? The terminal should definitely react to smkx if > it has that sequence in its terminfo database entry. Are you maybe > changing $TERM to something the terminal cannot handle? The problem is not with the terminal, but with that code sending the escape sequence to stdout (which doesn't have to be the terminal, in my case, it's a pipe and I don't want to get that smkx escape there (that's what breaking my script), instead of the terminal > If not, what are you doing that uses zle and is not connected to a > terminal? zle is connected to a terminal, not via stdout, zle doesn't use stdout for display and should not which is the whole point of this thread. I was just asking if there was a way for a zle function to output something to the terminal via the file descriptor that zsh keeps to the terminal (which is not stdout). Peter clearly answered the question in his first reply. -- Stephane