Repository navigation
Make prompt colors configurable - #18003
Closed
Dominik Kowalski (dkaszews) wants to merge 19 commits into
Closed
Dominik Kowalski (dkaszews) wants to merge 19 commits into
Dominik Kowalski (dkaszews) wants to merge 19 commits into
Conversation
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.
PR Summary
Allows user to configure prompt colors (e.g. when removing non-empty directories or explicitly giving
-Confirmflag). The configurable colors and the default values are as following (up to discussion):Changes in resource strings to avoid coloring trailing whitespace, which leads to visual artifacts for background colors.
Test had to be written by forking the powershell executable, as I could find no other way to both allow interactive prompt (disqualifies
[System.Management.Automation.PowerShell]even with test hooks) and capture output fromWrite(Line)ToConsole(disqualifies regular invocation, even with test hooks). Test is tagged slow because it takes up to 100 times longer than similar tests using[System.Management.Automation.PowerShell](80ms vs 8s), but if this method is too janky to use in CI, I can simply remove it and mark PR as "can only be tested interactively".Closes #17961
PR Context
Existing colors are hardcoded and are either yellow+white when on light background, or blue+black on white background. Because it is not really possible to reliably detect background colors, especially considering remoting over PSSession or ssh, or embedding sessions in screen or tmux, this leads to white text on white background, completely invisible.
Without PR:

With PR (defaults):

With PR (custom):

PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).