Reputation: 1087
History expansion of zsh always eats the first whitespace after the command. Here is an example:
$ zsh -df
$ echo hello world
hello world
$ ^[space]
echohello world
zsh: command not found: echohello
The issue also exists if I bind magic-space to the space key and use inline expansion.
If I do this with echo hello world
(two spaces between echo and hello) it keeps one and the command works.
I'm on Fedora 34 but this happens also on Fedora 15. What do I need to configure to get this working?
Upvotes: 1
Views: 104
Reputation: 531125
It's not missing a space; you are intentionally replacing the space with the empty string. ^
is used to make substitutions in the previous command.
% echo hello world
hello world
% ^hello^goodbye
echo goodbye world
goodbye world
Without the second ^
, it replaces the pattern with an empty string.
Upvotes: 2