From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19989 invoked from network); 18 Apr 1998 15:35:45 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Apr 1998 15:35:45 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id LAA12729; Sat, 18 Apr 1998 11:14:06 -0400 (EDT) Resent-Date: Sat, 18 Apr 1998 11:13:53 -0400 (EDT) From: TGAPE! Message-Id: <199804181011.KAA08845@dal-tsa19-60.cyberramp.net> Subject: Re: bindkey -s question To: duvall@dhduvall.student.princeton.edu (Danek Duvall) Date: Sat, 18 Apr 1998 10:11:54 +0000 (GMT) Cc: zsh-users@math.gatech.edu In-Reply-To: <19980418015157.A25326@lorien.princeton.edu> from "Danek Duvall" at Apr 18, 98 01:51:57 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"NBaBV3.0.H63.mCCEr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1471 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Danek Duvall wrote: > > I'm trying to bind ^L to a key sequence that will reset my xterm saved > lines. The escape sequence ^[c does the trick if I do > > echo -n c > > at the command line. However, if I try > > bindkey -s "^L" "echo -n ^[c" > > it just prints a new prompt as if I'd typed return. (Note I've typed all > the control charaters using ^V first; I'm just typing them safely here.) ^^ Right here's your key - -s puts the keys on the line as if you typed them. Try typing 'echo -n ^[c' on the command line and see what happens. Anyway, I think 'echo -n ^V^O' is what you really want; you then don't need to associate it with clear-screen. > I managed to get somewhat the behavior I want by > > zle -N clear-screen2 > function clear-screen2 () { echo -n ^[c; zle clear-screen } > bindkey "^L" clear-screen2 > > Without the call to clear-screen, the prompt doesn't get printed, but with > it there's a slight flash. Which tells you what would happen with what you're trying with the bindkey you're asking about - you'd get no prompt. I handle this with alias sanity='echo ^O; stty sane; stty -erase ^H' I avoid the situation enough that a keybinding is not called for. Considering the number of actual terminal lockups available from the same source as your messed up charset, I think avoidance is probably a good idea. (I saw one of those happen to a sysadmin at work, who was on console on a machine which must not go down. Oops. Funny thing was, he didn't realize it was a binary file until I showed it to him with less. And some people wonder why I hate /bin/more with a passion.) > I'm using xterm-70, if that makes any difference. It does - it means you're talking about a dec-vt style terminal, which is what I know best. You'll only have problems applying this to something weird like wyse terminals (what the hey?!?) or ansi (standards? Who ever follows standards?) (though dec-vt style is close enough to ansi that it might carry over.) Ed