Skip to content

Require word boundary in alias reminder prefix match - #2

Open
shinenelson wants to merge 1 commit into
vangie:mainfrom
shinenelson:fix/alias-word-boundary
Open

Require word boundary in alias reminder prefix match#2
shinenelson wants to merge 1 commit into
vangie:mainfrom
shinenelson:fix/alias-word-boundary

Conversation

@shinenelson

Copy link
Copy Markdown

The alias reminder compared the typed command against an alias's
expansion using a plain string prefix check, so any typed command
that happened to start with the expansion text matched — even when
the remaining characters weren't a separate argument. An alias like
...='cd ../../' then falsely fired for cd ../../another/path, a path
the alias can't reach, since using it would pass "../../" and
"another/path" as two separate arguments to cd instead of one
concatenated path. Require the match to land on a word boundary
(end of string or a following space) in bash, zsh, fish, and
nushell.

The alias reminder compared the typed command against an alias's
expansion using a plain string prefix check, so any typed command
that happened to start with the expansion text matched — even when
the remaining characters weren't a separate argument. An alias like
...='cd ../../' then falsely fired for cd ../../another/path, a path
the alias can't reach, since using it would pass "../../" and
"another/path" as two separate arguments to cd instead of one
concatenated path. Require the match to land on a word boundary
(end of string or a following space) in bash, zsh, fish, and
nushell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants