Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Getting the command in preexec as precisely typed
- X-seq: zsh-users 23954
- From: Sylvia Gough <q0h8xdveje@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Getting the command in preexec as precisely typed
- Date: Sun, 2 Jun 2019 17:45:02 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=O+cGv5Eefa5PglbqIJuxVZox36Qcwz+li6hOauyt2cI=; b=kFFJDGDAbcOAKhInN7QG/GbjXS+X6NADEGR0tIeKHUla+Eb1FnkjEro1E5bk2iwvoR +9fSgXU3KAir6BC0iBdSCS9ct1qlrCXBGM4Cc/QiOwKGiMWcJdnxhYL2HcW0vtrQERBY HUgJqvaCumJsN+kbyUzvY3S99eNBnaZG58U05TN3A7G6GDK/jzI1D83gDTyiKvd6CmWB ED/mvgrQkbiaaIxj9ffJ+kT264M1cAUu8r4ahBQ6NCOq8vXJVzNoTP6pU5B6CrXW52Oc lkZSvvFNLDw7QhpF49fwD4PoNlCdiNOvrW8zWX16pslT++9x38I5kyGMXepqmI83LYJ5 Zjxw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author