From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13918 invoked by alias); 9 Feb 2016 10:07:10 -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: 21257 Received: (qmail 22571 invoked from network); 9 Feb 2016 10:07:07 -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=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=DzflchndvDB+s534Eb2oezAE2uM=; b=pJo1U Ia7PgCcn4lC08B1d6JwAGZ66z4Q4l0OKrnQzEEaYvbdBr38pgF++OFvcT/eltq9P PqHVN7n9nE5+vdXn6EaFniXYq6VoLcpgA4vvkE8/ZUpi7d5nEEqIhYE5OTFwX+4s WBqJL50z464HooMyQnJL2Xc4SGkVoQVYFd90W0= X-Sasl-enc: tlf2JNInLYflu6IzLl1aBsZPEOpUxx3inNM1KiJXeZgY 1455012426 To: zsh-users@zsh.org From: Andrew Janke Subject: Best practice for smkx and ZLE? Message-ID: <56B9BA4A.30805@apjanke.net> Date: Tue, 9 Feb 2016 05:07:06 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Zsh folks, Is there a consensus in the Zsh community about whether we should generally be using smkx/rmkx in zle-line-init/finish to switch in to application keypad mode when ZLE is active? And if so, where it's best to configure this - i.e. in system-wide /etc/z* files vs. individual user's ~/.zshrc? I've run in to this a few times working with my own config files and with Oh My Zsh, and am wondering whether the generally accepted thing is to do so at this point. On the upside, doing `smkx` means you can use the terminfo entries to portably get the character sequences for the arrow and home/end keys. On the downside: - zle_line_init() doesn't compose easily (like $precmd_functions and other multi hooks do), so one init file's definition can clobber another's, and whoever defines the effective zle_line_init must include it. - smkx (usually) puts both the cursor and numeric keypads in to application mode. There's no default binding for the sequences emitted by the numeric keypad in app mode, so using it gives you junk on the command line, instead of numbers. - Among smaller terminal emulators, there's more variability in behavior in application mode than in normal mode. E.g. some don't change Home and End behavior while in cursor application mode, or respect smkx at all, though they still set $TERM to 'xterm'. But their normal mode behavior tends to match xterm's. So terminfo-based cursor key bindings may end up being less portable in practice. There've been a few discussions about it on this list with respect to particular problems. http://www.zsh.org/mla/users//2010/msg00065.html http://www.zsh.org/mla/users//2014/msg00567.html http://www.zsh.org/mla/users//2014/msg00030.html But I don't know if there's general consensus, and I haven't seen anything in the Zsh reference manual or other documentation recommending it for general use. Any conclusions on this? Cheers, Andrew Janke