zsh-users
 help / color / mirror / code / Atom feed
From: Hauke Petersen <hkptrsn@gmail.com>
To: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: Colored-character displayed on CTRL-C ?
Date: Mon, 23 Sep 2013 23:36:19 +0200	[thread overview]
Message-ID: <CANWLQWv-buLdcxZsxgiJ=9D-isAksppPTTb_oZqezQub3Vo=aA@mail.gmail.com> (raw)
In-Reply-To: <CE65CA5F.235C2%larrys@fb.com>

On Mon, Sep 23, 2013 at 7:37 PM, Larry Schrof <larrys@fb.com> wrote:
> I'd really like ideas on the best way to tell zsh to display a
> character with a yellow background on CTRL-C, followed by taking
> me to a new prompt on the next line.

One attempt:

    [[ -o interactive ]] && function TRAPINT {
        zle && print -nP '%B%S^C%s%b'
        return $(( 128 + $1 ))
    }

`[[ -o interactive ]]' is to only define the trap in interactive
shells. `zle && ...' to only print ^C when the line editor is active.
`print -P' interprets prompt escape codes. %B and %b mark bold, %S and
%s standout/invert. That's the same format as the default
PROMPT_EOL_MARK. You can find other formatting options (prompt
escapes) in zshmisc(1).

-- 
[Resending this, evil gmail tried to keep it off the list.]


      parent reply	other threads:[~2013-09-23 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 17:37 Larry Schrof
2013-09-23 19:26 ` Phil Pennock
2013-09-23 21:10   ` Phil Pennock
2013-09-24  2:58     ` Bart Schaefer
2013-09-23 20:02 ` Bart Schaefer
2013-09-23 22:00   ` Phil Pennock
2013-09-24  6:24     ` Bart Schaefer
2013-09-23 21:36 ` Hauke Petersen [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='CANWLQWv-buLdcxZsxgiJ=9D-isAksppPTTb_oZqezQub3Vo=aA@mail.gmail.com' \
    --to=hkptrsn@gmail.com \
    --cc=zsh-users@zsh.org \
    /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).