Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Getting the command in preexec as precisely typed



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