pub fn is_command_position(prefix: &str) -> boolExpand description
Returns true when the characters to the left of the token we’re about to
consider represent a position where a fresh command name is expected.
Command position is:
- the very start of the line (after trimming trailing spaces), or
- immediately after a pipeline / list operator (
|,||,&&,;), or - immediately after
sudothat is itself in command position (e.g.sudo gcmshould still expandgcm).
Anything else (mid-arguments, after =, inside a command’s arguments) is
treated as non-command-position and abbreviations should not expand.