zsh-users
 help / color / mirror / code / Atom feed
From: Boyd Adamson <boyd-adamson@usa.net>
To: zsh-users@sunsite.dk
Subject: The old backspace/delete problem
Date: Thu, 20 Jan 2005 00:12:32 +1100	[thread overview]
Message-ID: <87ekghftq7.fsf@eddy.tactio.lan> (raw)

Someone recently mentioned to me a solution to the old "backspace key
sends ^? or ^H" problem that I hadn't heard of, and I thought we here
in zsh land might be able to improve on it.

The solution I saw was for a ksh user:

alias ^?='stty erase ^?'
alias ^H='stty erase ^H'

The idea is that on login, the user types <backspace><enter>. This
will do one of two things:
1. The character sent by the backspace key will match the current tty
   setting. In this case nothing happens except for a new prompt, or,
2. The character sent by the backspace key does not match the current
   tty setting, the alias is expanded and the tty setting is changed
   to match the terminal emulator.

Now this is nice, but it doesn't help those of use who use a superior
shell, since both ^? and ^H are normally mapped to the same function
(something like backward-delete-char). This is nice in the shell, but
potentially leaves us with a broken backspace key in other command
line programs.

Any ideas on how we could do this sort of auto-detection in zsh? What
about the ability to automatically do the stty stuff the first time we
receive a ^H or ^?, even in the middle of the command? Something like
this:

$ cd /usr/liv<backspace>

causes stty erase <whatever> to be run in the background and then
backward-delete-char - and after that fall back to the normal
behavior.

Any thoughts? Is this just crazy? Or has it been done before?

Boyd


             reply	other threads:[~2005-01-19 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19 13:12 Boyd Adamson [this message]
2005-01-19 14:22 ` Peter Stephenson
2005-01-19 17:36   ` Bart Schaefer
2005-01-19 18:10     ` Peter Stephenson
2005-01-24 20:36       ` Seth Kurtzberg
2005-01-20  3:33   ` Boyd Adamson

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=87ekghftq7.fsf@eddy.tactio.lan \
    --to=boyd-adamson@usa.net \
    --cc=zsh-users@sunsite.dk \
    /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).