Skip to content

Conversation

@rkeithhill
Copy link
Collaborator

@rkeithhill rkeithhill commented Nov 25, 2021

PR Summary

This PR does not set -nologo as the default, instead it removes the
copyright line, the two "how to get help" lines and two blank lines
around the "how to get help" lines.

The following is the resulting startup banner when there is no update available OR the user has disabled updating checking via the POWERSHELL_UPDATECHECK environment variable:

image

compare this with the current startup banner:

image

When there is an update available AND the user has not disabled update checking, the reduced startup banner looks like this:

image

If we decide that we want to keep the Type 'help' to get help. text, I propose something like this:

image

image

BTW here are some other startup banners for comparison:

image

As you can see, bash and nodejs have no startup banner text at all and Python's is a bit wordy. :-)

PR Context

Addresses #15644

Regarding documentation impact, I think this would only impact images/text blocks where the PowerShell startup banner is shown. But what I'm seeing so far in the online help is images of Windows PowerShell startup banner text. @sdwheeler are there areas of the online help where PowerShell v6/7 startup banner text is shown?

This PR currently leaves the profile timing text as-is.

The PR is meant to give folks a way to test drive a reduced startup banner.

PR Checklist

This PR does not set -nologo as the default, instead it removes the
copyright line, the two "how to get help" lines and two blank lines
around the "how to get help" lines.
@iSazonov
Copy link
Collaborator

Convert to draft until PowerShell Committee conclusion.

@sdwheeler
Copy link
Collaborator

There are 3 articles:

@rkeithhill rkeithhill changed the title Fix #15644 - reduce the amount of startup banner text WIP: Fix #15644 - reduce the amount of startup banner text Nov 25, 2021
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 29, 2021
@ghost ghost added the Stale label Dec 14, 2021
@ghost
Copy link

ghost commented Dec 14, 2021

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

@daxian-dbw daxian-dbw added Review - Committee The PR/Issue needs a review from the PowerShell Committee and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept Stale labels Dec 14, 2021
@SteveL-MSFT
Copy link
Member

@rkeithhill would you mind adding a test?

@SteveL-MSFT
Copy link
Member

@PowerShell/powershell-committee reviewed this, we are ok taking this PR with just the PowerShell <version> logo and getting user feedback. We still need to follow-up with Microsoft to ensure we are ok without the copyright notice, but that's something we can address later and doesn't block this PR.

@SteveL-MSFT SteveL-MSFT added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Dec 15, 2021
@SteveL-MSFT SteveL-MSFT marked this pull request as ready for review December 15, 2021 23:19
@SteveL-MSFT SteveL-MSFT changed the title WIP: Fix #15644 - reduce the amount of startup banner text Reduce the amount of startup banner text Dec 15, 2021
@rkeithhill
Copy link
Collaborator Author

@SteveL-MSFT I can add look at adding a test. Are there any existing tests for the startup banner text?

@iSazonov
Copy link
Collaborator

@rkeithhill We have xUnit tests in test_CommandLineParser.cs. You could add new tests in the file.

@iSazonov
Copy link
Collaborator

@PowerShell/powershell-committee reviewed this, we are ok taking this PR with just the PowerShell <version> logo and getting user feedback. We still need to follow-up with Microsoft to ensure we are ok without the copyright notice, but that's something we can address later and doesn't block this PR.

There is a related problems with "". I'd ask the team and PowerShell Committee to look #15607 (comment) so that we could continue with #15603.

@ghost ghost added the Review - Needed The PR is being reviewed label Dec 24, 2021
@ghost
Copy link

ghost commented Dec 24, 2021

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@rkeithhill
Copy link
Collaborator Author

@SteveL-MSFT I think the best place for tests is in ConsoleHost.Tests.ps1. However, I'm a bit stumped on how to test this. All of the other tests in this file appear to use either -File or -Command in order to run pwsh, execute script, exit and capture the output. In those cases, no startup banner is output. If you run without those parameters, you get the startup banner in the new pwsh session but that session doesn't exit and getting the startup banner text from that session isn't exactly straightforward.

@rkeithhill
Copy link
Collaborator Author

rkeithhill commented Jan 7, 2022

FYI, I'm trying to sort out the Linux Pester test failure but the line number the log shows seems odd. Anyway, trying to build & run my tests on WSL/Ubuntu to see if I can repro locally.

@rkeithhill
Copy link
Collaborator Author

rkeithhill commented Jan 7, 2022

@iSazonov @adityapatwardhan Any idea why I would be getting this ANSI in my output from the Azure Pipelines / PowerShell-CI-macos & Azure Pipelines / PowerShell-CI-linux tests?

WARNING: pwsh output is: 'PowerShell 7.3.0-preview.2\nPS /home/vsts/work/1/s> 1hexit\n1l'

What's with the 1h, extra newline and final 1l? I suppose I need to disable ANSI for the new pwsh process? Now I'm wanting a -NoAnsi switch to pwsh.exe. Update: ah, this seems to be DECCKM enable/disable.

@iSazonov
Copy link
Collaborator

iSazonov commented Jan 8, 2022

@rkeithhill You could set env variable TERM=dumb to disable VT mode.

@rkeithhill
Copy link
Collaborator Author

@iSazonov Thanks but I've found something that works. I'm not keen to set the TERM=dumb on the Pester process side. And doing it in the new pwsh process isn't much different than my current fix which is to first execute: $PSStyle.OutputRendering = 'PlainText'.

@iSazonov
Copy link
Collaborator

iSazonov commented Jan 9, 2022

TERM=dumb turns off DECCKM too and simplify the test code.

@pull-request-quantifier-deprecated

This PR has 52 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Small
Size       : +46 -6
Percentile : 20.8%

Total files changed: 4

Change summary by file extension:
.cs : +1 -1
.resx : +2 -5
.ps1 : +43 -0

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@rkeithhill
Copy link
Collaborator Author

TERM=dumb turns off DECCKM too and simplify the test code.

@iSazonov Done. Thanks.

@rkeithhill
Copy link
Collaborator Author

@adityapatwardhan This PR is ready to go (merge).

Comment on lines +847 to +849
# Set TERM to "dumb" to avoid DECCKM codes in the output
$oldTERM = $env:TERM
$env:TERM = "dumb"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done only on non-Windows?

Copy link
Collaborator Author

@rkeithhill rkeithhill Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably only needs to be done non-WIndows since the DECCKM failures I saw were on mac/linux. That said, I don't believe it hurts to set TERM="dumb" on Windows.

@adityapatwardhan adityapatwardhan merged commit e2f39fa into PowerShell:master Jan 10, 2022
@adityapatwardhan
Copy link
Member

@rkeithhill Thank you for your contribution!

@rkeithhill rkeithhill deleted the rkeithhill/minimal-startup-text branch January 10, 2022 23:27
TrapGodBrim pushed a commit to TrapGodBrim/PowerShell that referenced this pull request Jan 19, 2022
@ghost
Copy link

ghost commented Feb 24, 2022

🎉v7.3.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

@DHowett
Copy link

DHowett commented Feb 25, 2022

I just noticed this. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants