I suppose you mean that when you
TAB complete a command / filename a space is added automatically, but after pressing
| it vanishes again.
Otherwise I can't reproduce that effect.
However, in that case the solution should be as simple as
The explanation is a litly bit tricky, so I simply quote
These parameters are used by the line editor. In certain circumstances suffixes (typically space or slash) added by
completion system will be removed automatically, either because the next editing command was not an insertable character,
or because the character was marked as requiring the suffix to be removed.
These variables can contain the sets of characters that will cause the suffix to be removed. If
is set, those characters will cause the suffix to be removed; if
ZLE_SPACE_SUFFIX_CHARS is set, those characters will
cause the suffix to be removed and replaced by a space.
ZLE_REMOVE_SUFFIX_CHARS is not set, the default behaviour is equivalent to:
ZLE_REMOVE_SUFFIX_CHARS is set but is empty, no characters have this behaviour.
ZLE_SPACE_SUFFIX_CHARS takes precedence, so that the following:
causes the characters
| to remove the suffix but to replace it with a space.
To illustrate the difference, suppose that the option
AUTO_REMOVE_SLASH is in effect and the directory DIR has just been
completed, with an appended
/, following which the user types
&. The default result is
ZLE_REMOVE_SUFFIX_CHARS set but without including
& the result is
ZLE_SPACE_SUFFIX_CHARS set to include
& the result
Note that certain completions may provide their own suffix removal or replacement behaviour which overrides the values