zsh-users
 help / color / mirror / code / Atom feed
From: TGAPE! <tgape@cyberramp.net>
To: duvall@dhduvall.student.princeton.edu (Danek Duvall)
Cc: zsh-users@math.gatech.edu
Subject: Re: bindkey -s question
Date: Sat, 18 Apr 1998 10:11:54 +0000 (GMT)	[thread overview]
Message-ID: <199804181011.KAA08845@dal-tsa19-60.cyberramp.net> (raw)
In-Reply-To: <19980418015157.A25326@lorien.princeton.edu> from "Danek Duvall" at Apr 18, 98 01:51:57 am

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


  reply	other threads:[~1998-04-18 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-18  5:51 Danek Duvall
1998-04-18 10:11 ` TGAPE! [this message]
1998-04-18 15:42   ` Danek Duvall
1998-04-25 13:55 Mirar
1998-04-27  8:47 ` Andrew Main

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=199804181011.KAA08845@dal-tsa19-60.cyberramp.net \
    --to=tgape@cyberramp.net \
    --cc=duvall@dhduvall.student.princeton.edu \
    --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).