From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14325 invoked by alias); 3 Jun 2011 23:48:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29454 Received: (qmail 21975 invoked from network); 3 Jun 2011 23:48:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at gmx.de designates 213.165.64.22 as permitted sender) X-Authenticated: #9006135 X-Provags-ID: V01U2FsdGVkX18Z6ktV7qQZ8hPSLhTfUrYDP9DOgs/soAiZY8dJPd bvqH/IW56H4u1Y Content-Type: text/plain; charset=UTF-8 Subject: select item from list in modify-current-argument? From: Marc Weber To: zsh-workers Date: Sat, 04 Jun 2011 01:41:36 +0200 Message-Id: <1307144249-sup-4787@nixos> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 I have my own tool for selecting paths (github.com/MarcWeber/path-selector). I'd like to use it within ZSH. I came up with this: http://dpaste.com/550269/ (You can replace line 78 by 79) select-one first uses echo to show the alternatives, then read to get the item index from the user. However because echo shows many lines the code copied from modify-current-argument get's confused. ctl-l redraws the current line but drops some history. zle -R does not help Is there an even better way to implement select-one? Pointing me to sample code will be enough. Marc Weber