From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12587 invoked by alias); 17 Dec 2014 18:34:41 -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: 33997 Received: (qmail 27486 invoked from network); 17 Dec 2014 18:34:38 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1418840866; bh=immCPYX1B5abBfwxud/OUWs4mA1LgbaBjQjPbwv54lg=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=g4N2U+1yyefdbgHMVJcO+1qr2T/i3F8YYJgdfO0zFaFjkGf/CIy1wPlgkwKe413ktUqIyJK0o39fjldUP1oQhxIJc1aa5cPq8MnjFvUvVg+4IFF055H2Ykj0WCSQpY7pR0oNlt3gPpj1SsOiQvIMQOcjAnFAbLt+k/nNy0hL+oXEj3VGEW+wSQJRf4vnBzqiIeOnJ2oOosLP+KuWdaB5Tgkej8OkXjTJlb0mFeFQVOHhGJ269Rc/SFsoPjLmROq7ejKiGvTlT64fHsKoiUGBQhiMmf3n0rEpaVZTGzVLm2OzBwq6SXVtTRX5XnqbpNUeeC1+jTPlg4/yqy3dA6uRmg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=ctwwk/xzJgu8+/kGj7oyk7870ith4wnH1Kop1ZRzxzrKd1XSRRuRN5BN/BkN0nVUnNOAAipvjigR6606E21EgDEpyRYQgOp5v26IhZ+3Ucin87j6fQsWK1zwsbKtcnUrzSs6LP/rYVJT5xUUbiWUh9JJPMjQg3wdckF5tSrBApdAO7JhAylo12otk/SYzX6IoHTvCEf8iVerUchgx84/yiwfV0pUwvv1wgSHiq0a9JN85LTpEJdJjzfgkFVQgqCrCugNHw3Ek4c7GTq9ueI1BGMIxb4Hs1UtMxwOeuQRadL3JKn/DYJKJZ7eIozSIhA2sO/BpzYXjlh8oQo/p70cxQ==; X-Yahoo-Newman-Id: 542184.2488.bm@smtp112.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: v.GT1yMVM1mkClLrc7bC1DOT6LsFfTwr6JwDyQOE8G_xxNR mbZJS4Zre_dX6RYmYF_TGePw_wNOZOagM0Wh6cb6e77.rW_aXNbNCdLOvmWx 9wH0Cno3Bz6QNlf30kE1yDBiM.Xsyhsyssu9CFKRHKmUJlgpcguk_LeGbjFr bdRrX18bFpySRcReqzsveyxQ7TgKRgvkmiWQcCzj0BsbnWRNP6CFBAePa4gj zC0C9CQcBOdAfRe4ZtjFPirDrOa8o17jXfj6lKEz0ZQ6__any3iaUjnY0d8M keVmqchyQbDDLsqo0fVtCAzI8w4Swa_t28KQdXj27tfPFbNEBNWSiKFPmEm_ 0xa5eaTfMbIZ0y0HGRFE83gVfne2h.h87z8iy0ynaskcE5GdisCrHAG7dvIN L8BYYGe6r.6JseYcVdwbu0iHW2ixJdPdvGJ2dIdzxGqcRflbxTQ80AnXxdV5 .YzBaSNr2si._WpX6Vy6NA4BzhEcmhe4O8s0cJ0ki3uIpmHRfkMKiUuD1RgY krwdtRAS4zXuAATOR.KK2_Dzuk2WuGQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <141217085549.ZM555@torch.brasslantern.com> From: Oliver Kiddle References: <20141217075818.GA5675@Persephone> <141217085549.ZM555@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: Fwd: In Vi mode, show whether "insert" or "command" state is active MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5707.1418840864.1@quattro> Date: Wed, 17 Dec 2014 19:27:44 +0100 Message-ID: <5708.1418840864@quattro> Bart wrote: > > } zle-keymap-select () { > } if [ $KEYMAP = vicmd ]; then > } echo -en "\e[5 q" > } else > } echo -en "\e[1 q" > } fi > } zle reset-prompt > } } > } zle -N zle-keymap-select > > You don't even need the reset-prompt in that case because you're echo'ng > a nonprinting sequence that causes the terminal to change the cursor > shape. However, you will need to ensure that the cursor is always reset when a line is accepted. Most reliable place to do that appears to be POSTEDIT: POSTEDIT+=$'\e[2 q' I find the cursor shape is actually much better than the prompt (or right prompt) for indicating the mode. Only problem is that it can be hard to find a narrow bar style cursor in a screenful of text. I'd also recommend configuring either the zle highlighting of the region or the cursor to use some colour. If you take the defaults of both zsh and most terminal emulators, the cursor is a large inverse block and the region is highlighted in inverse video. This makes it hard to tell where the cursor is and whether the cursor position is included in the region or not. Oliver