[PR #13476] Allow leading spaces to bypass console aliases #29575

Closed
opened 2026-01-31 09:35:42 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13476

State: closed
Merged: Yes


Summary of the Pull Request

When you create a console alias that overrides an existing command, it
should still be possible to execute the original command by prefixing it
with a space. However, at some point in the past, there was an attempt
to improve the usability by trimming leading spaces, and that ended up
breaking this functionality. This PR reverts that change, so leading
spaces can once again be used to bypass an alias.

PR Checklist

Validation Steps Performed

I've updated the existing alias unit test for leading spaces to match
the new behavior, i.e. it now confirms that a command with leading
spaces will not match the alias.

I've also manually confirmed that the doskey test case reported in
issue #4189 is now working as expected.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13476 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request When you create a console alias that overrides an existing command, it should still be possible to execute the original command by prefixing it with a space. However, at some point in the past, there was an attempt to improve the usability by trimming leading spaces, and that ended up breaking this functionality. This PR reverts that change, so leading spaces can once again be used to bypass an alias. ## PR Checklist * [x] Closes #4189 * [x] CLA signed. * [x] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [x] I've discussed this with core contributors already. Issue number where discussion took place: #4189 ## Validation Steps Performed I've updated the existing alias unit test for leading spaces to match the new behavior, i.e. it now confirms that a command with leading spaces will not match the alias. I've also manually confirmed that the `doskey` test case reported in issue #4189 is now working as expected.
claunia added the pull-request label 2026-01-31 09:35:42 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29575