zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: heiko_elger@arburg.com
Cc: zsh-users@math.gatech.edu
Subject: Re: Xterm and CURSOR (INS && OVERRIDE)
Date: Wed, 5 Aug 1998 15:03:06 -0700	[thread overview]
Message-ID: <980805150306.ZM1826@candle.brasslantern.com> (raw)
In-Reply-To: <0000581F.@arburg.com>

On Aug 3,  6:49am, heiko_elger@arburg.com wrote:
} Subject: Xterm and CURSOR (INS && OVERRIDE)
}
} Is it possible to send an escape sequence when pressing the INS key to change 
} the cursor in the XTERM (AIXTERM), e.x. INSERT MODE --> full cursor, OVERRIDE 
} MODE small cursor.

In 3.1.4, this should do it; you may need to swap vs and ve, or use some
other termcap sequence, to get the cursor you want in each case:

	INSkey='\e[2~'	# The sequence sent by the INS key

	function overwrite_change_cursor {
	    bindkey "$INSkey" insert_change_cursor
	    zle overwrite-mode
	    echotc vs
	}

	function insert_change_cursor {
	    bindkey "$INSkey" overwrite_change_cursor
	    zle overwrite-mode
	    echotc ve
	}

	zle -N overwrite_change_cursor overwrite_change_cursor
	zle -N insert_change_cursor insert_change_cursor

	function precmd {
	    if [[ -o overstrike ]]
	    then
		echotc vs
		bindkey "$INSkey" insert_change_cursor
	    else
		echotc ve
		bindkey "$INSkey" overwrite_change_cursor
	    fi
	}

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


      parent reply	other threads:[~1998-08-05 22:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-03  5:49 heiko_elger
1998-08-03  8:42 ` Peter Stephenson
1998-08-03  8:53   ` Peter Stephenson
1998-08-05 22:03 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=980805150306.ZM1826@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=heiko_elger@arburg.com \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).