zsh-users
 help / Atom feed
From: Sylvia Gough <q0h8xdveje@gmail.com>
To: zsh-users@zsh.org
Subject: Getting the command in preexec as precisely typed
Date: Sun, 2 Jun 2019 17:45:02 +0300
Message-ID: <CA+E8bhofxWgV+BG+a2p8wN3dy6VjLX28EAeH=DXM7LWHH63h9Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

Hey,

The zsh manual says about `preexec` that: "the string that the user  typed
is passed  as  the  first argument". This mostly work as expected, but I
found cases where there is some expansion going on. In order to debug the
issue I'm seeing, I have this zsh code run from my zshrc:

```zsh
echo_preexec_command() {
  echo "$1" | cat -A
}
autoload -U add-zsh-hook
add-zsh-hook preexec echo_preexec_command
```

Now if I type `echo \b` the string `echo ^H$` is printed (i.e. `\b` was
replaced by `^H`).
This does not happen when using `fc -nl -1`.

How  can I get the same inside `preexec`?

Thanks!

             reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-02 14:45 Sylvia Gough [this message]
2019-06-02 16:03 ` Sebastian Gniazdowski
2019-06-02 21:22   ` Sylvia Gough
2019-06-03  9:26     ` Roman Perepelitsa
2019-06-03  9:39       ` Sylvia Gough

Reply instructions:

You may reply publically 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='CA+E8bhofxWgV+BG+a2p8wN3dy6VjLX28EAeH=DXM7LWHH63h9Q@mail.gmail.com' \
    --to=q0h8xdveje@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

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox