Repository navigation
Stop profile aliases from shadowing built-in commands - #8
Merged
Merged
Conversation
The profile removed the built-in gc/ls/cat aliases with Remove-Alias and redefined them, which replaced Get-Content/Get-ChildItem for the whole session, including scripts invoked from the prompt. - Rename the git-commit helper gc -> gcmsg and drop Remove-Alias gc. - Expose eza via la/ll/lt only; leave the built-in ls alias intact. - Expose bat via bcat; leave the built-in cat alias intact. - ssh: consult `ssh -G <host>` and add ConnectTimeout/ServerAlive* only where neither the command line nor ~/.ssh/config already set them. - Correct the misleading gpush/gpull alias comments. - Update help text, command registry, README, and tests to match.
bcat is a new command exposed only when bat is installed. The coverage audit parses the profile statically, so it sees the bcat function regardless of the runtime bat guard and flagged it as an uncovered export, failing the functional job. Probe bcat when bat is present and skip it with a reason otherwise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why (draft: PowerShell runtime behavior not fully verifiable here)
The profile called
Remove-Aliason the built-ingc,ls, andcataliases and then redefined them. Because the alias table is shared across the whole session, this replacedGet-Content/Get-ChildItemfor every script run afterward (e.g. a script at the prompt doinggc config.jsonorcat x), not just the interactive prompt.Changes
gc->gcmsg: rename the git-commit helper and removeRemove-Alias gc, so the built-ingc(Get-Content) stays intact.ls: drop theRemove-Alias ls+function ls; keep eza underla/ll/lt(which do not collide with a built-in alias).lsstays Get-ChildItem.cat: drop theRemove-Alias cat+function cat; expose bat asbcat.catstays Get-Content.ssh -G <host>and addsConnectTimeout/ServerAliveInterval/ServerAliveCountMaxonly where neither the command line nor~/.ssh/configalready set them (ssh -G reports unset ConnectTimeout asnone, unset ServerAliveInterval as0). Previously it keyed only off the command line and would override values from~/.ssh/config.gpush/gpullcomments (they claimed to removegp/glaliases and misnamed the built-ins).Show-Helptext, the command registry, README alias tables, and thegctest call sites (tests/test.ps1,tests/ci-functional.ps1) to match.Findings / rationale
ls/catprobes already exercised the built-ins, so they stay valid;gcmsgis defined unconditionally.Verification
Parser::ParseFileclean on profile,tests/test.ps1,tests/ci-functional.ps1.ssh.exe+ an interactive session for the tab-title path);bcatonly exists whenbatis installed. No workflows touched.