zsh-users
 help / color / mirror / code / Atom feed
* Getting the command in preexec as precisely typed
@ 2019-06-02 14:45 Sylvia Gough
  2019-06-02 16:03 ` Sebastian Gniazdowski
  0 siblings, 1 reply; 5+ messages in thread
From: Sylvia Gough @ 2019-06-02 14:45 UTC (permalink / raw)
  To: zsh-users

[-- 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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-03  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-02 14:45 Getting the command in preexec as precisely typed Sylvia Gough
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

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).