You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this is because the second argument to the preexec hook can be trimmed and what we really want is to compare the command with the third argument, which is not trimmed.
Another issue is with export (maybe some other builtins too, but I've only seen export so far):
$ export TEST=x
Alias for: export TEST=x
This one is because expanded command for some reason has a trailing whitespace. I'm not sure, maybe this is actually a zsh bug, but we can easily workaround this by removing the trailing whitespace before doing comparison.
Would you be interested in PRs to fix that? Any objections to
Using CMD_EXPANDED=$3 instead of CMD_EXPANDED=$2
Removal trailing whitespace from CMD/CMD_EXPANDED?
The text was updated successfully, but these errors were encountered:
The actual command that will be executed (including expanded aliases) is passed in two different forms: the second argument is a single-line, size-limited version of the command (with things like function bodies elided); the third argument contains the full text that is being executed.
What I experience currently is long commands are falsely detected as aliases. I believe this is exactly because the second argument to the hook is size-limited.
I've found some unexpected "Alias for:" messages, especially while running particularly long commands:
I believe this is because the second argument to the preexec hook can be trimmed and what we really want is to compare the command with the third argument, which is not trimmed.
Another issue is with
export
(maybe some other builtins too, but I've only seen export so far):This one is because expanded command for some reason has a trailing whitespace. I'm not sure, maybe this is actually a zsh bug, but we can easily workaround this by removing the trailing whitespace before doing comparison.
Would you be interested in PRs to fix that? Any objections to
CMD_EXPANDED=$3
instead ofCMD_EXPANDED=$2
The text was updated successfully, but these errors were encountered: