The 'stty erase ^H' fixed it. Why is '^?' the default erase and not this?
I also had to setup the following in iTerm keyboard profiles to get it to work consistently in emacs shell mode and vi. Delete (which is backspace) sends hex code 8 Del (which is forward delete) sends escape sequence [3~
Now everything works consistently.
Kasey
On Mar 16, 2007, at 5:21 PM, Oscar Pitts wrote: Perhaps;
$ stty erase ^h
You will likely find that the built in emacs mode will save quite a few keystrokes over vi mode:
$ set -o emacs
Some shells , e.g. bash, can do:
$ set -o gmacs ; # which includes setting ^h to destructive backspace
Destructive backspace was a flame war issue many years ago. Please let us not rekindle it.
On 3/16/07, email@hidden <email@hidden> wrote: Send Darwin-userlevel mailing list submissions to email@hidden
To subscribe or unsubscribe via the World Wide Web, visit http://lists.apple.com/mailman/listinfo/darwin-userlevel or, via email, send a message with subject or body 'help' to email@hidden
You can reach the person managing the list at email@hidden
When replying, please edit your Subject line so it is more specific than "Re: Contents of Darwin-userlevel digest..."
Today's Topics:
1. shell annoyances (Kasey Speakman)
----------------------------------------------------------------------
Message: 1 Date: Fri, 16 Mar 2007 09:22:28 -0500 (CDT) From: "Kasey Speakman" <email@hidden> Subject: shell annoyances To: email@hidden Message-ID: <email@hidden">email@hidden> Content-Type: text/plain;charset=iso-8859-1
Dear list,
I have a question about using the shell and ssh. Firstly, I've already been through the pain of getting Delete, Backspace, Home, and End to work in both local and remote shells, as well as vi. I'm a bit disappointed that these things are not already in place, as they are in Linux.
I'm using iTerm, as it seems to have better defaults, and it does tabbed terminals, but Terminal.app tends to suffer the same ills.
Anyway, my question is about using backspace while a program is running. The main example of this is when I ssh to a server and the key password prompt comes up. If I know I made a mistake typing in Linux, I can just hit backspace a number of times (even though the cursor never moves), and retype the password, no problem. But in OS X iTerm, the backspace gets sent as ^H in this circumstance, and so there's no way to back up over your input.
Another illustration of this is using an rsync command that runs a while (this is the reason I know that ^H is sent rather than backspace). Say I'm running a rsync on large amounts of data and it takes a while to run. Like so:
rsync -a /big/files /backup
Now, normally, as I'm sitting there waiting, I can type another command and hit enter and that command will execute after rsync finishes. However, what if I notice my syntax for the next command is wrong or I mistyped? In Linux, I can just backspace over what I typed. But in OS X iTerm, I get ^H printed out for every backspace. How do I fix that?
------------------------------
_______________________________________________ Darwin-userlevel mailing list email@hidden http://lists.apple.com/mailman/listinfo/darwin-userlevel
End of Darwin-userlevel Digest, Vol 4, Issue 14 ***********************************************
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. _______________________________________________ Do not post admin requests to the list. They will be ignored. Help/Unsubscribe/Update your Subscription:
|