Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PowerShell/PSReadLine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0-rc1
Choose a base ref
...
head repository: PowerShell/PSReadLine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 20,602 additions and 3,339 deletions.
  1. +9 −0 .config/tsaoptions.json
  2. +10 −0 .github/CODE_OF_CONDUCT.md
  3. +115 −0 .github/CONTRIBUTING.md
  4. +41 −14 .github/{ISSUE_TEMPLATE.md → ISSUE_TEMPLATE/Bug_Report.md}
  5. +102 −0 .github/ISSUE_TEMPLATE/Bug_Report.yaml
  6. +15 −0 .github/ISSUE_TEMPLATE/Documentation_Issue.yaml
  7. +23 −0 .github/ISSUE_TEMPLATE/Feature_Request.yaml
  8. +1 −0 .github/ISSUE_TEMPLATE/config.yml
  9. +18 −0 .github/PULL_REQUEST_TEMPLATE.md
  10. +41 −0 .github/SECURITY.md
  11. +315 −0 .github/policies/resourceManagement.yml
  12. +34 −0 .github/workflows/IssuePreTriage.yml
  13. +4 −0 .gitignore
  14. +307 −0 .pipelines/PSReadLine-Official.yml
  15. +0 −126 .vsts-ci/releaseBuild.yml
  16. +0 −8 .vsts-ci/sign-catalog.xml
  17. +0 −14 .vsts-ci/sign-module-files.xml
  18. +0 −21 LICENSE
  19. 0 {PSReadLine → }/License.txt
  20. +7 −10 MockPSConsole/MockPSConsole.csproj
  21. +1 −1 MockPSConsole/Program.cs
  22. +66 −112 PSReadLine.build.ps1
  23. +165 −59 PSReadLine/BasicEditing.cs
  24. +373 −2 PSReadLine/Changes.txt
  25. +3 −3 PSReadLine/CharMap.cs
  26. +19 −18 PSReadLine/Clipboard.cs
  27. +212 −28 PSReadLine/Cmdlets.cs
  28. +199 −131 PSReadLine/Completion.cs
  29. +43 −5 PSReadLine/ConsoleLib.cs
  30. +89 −0 PSReadLine/DisplayBlockBase.cs
  31. +7 −0 PSReadLine/Disposable.cs
  32. +305 −0 PSReadLine/DynamicHelp.cs
  33. +462 −67 PSReadLine/History.cs
  34. +118 −74 PSReadLine/KeyBindings.cs
  35. +38 −12 PSReadLine/KeyBindings.vi.cs
  36. +9 −6 PSReadLine/Keys.cs
  37. +229 −5 PSReadLine/KillYank.cs
  38. +62 −46 PSReadLine/Movement.cs
  39. +16 −18 PSReadLine/Movement.vi.cs
  40. +2 −2 PSReadLine/Movement.vi.multiline.cs
  41. +0 −72 PSReadLine/MultiLineBufferHelper.cs
  42. +37 −0 PSReadLine/OnImportAndRemove.cs
  43. +131 −0 PSReadLine/Options.cs
  44. +18 −21 PSReadLine/PSReadLine.csproj
  45. +25 −0 PSReadLine/PSReadLine.format.ps1xml
  46. +4 −6 PSReadLine/PSReadLine.psd1
  47. +7 −1 PSReadLine/PSReadLine.psm1
  48. +2 −0 PSReadLine/PSReadLine.sln
  49. +273 −18 PSReadLine/PSReadLineResources.Designer.cs
  50. +114 −19 PSReadLine/PSReadLineResources.resx
  51. +535 −28 PSReadLine/PlatformWindows.cs
  52. +19 −29 PSReadLine/Position.cs
  53. +428 −0 PSReadLine/Prediction.Entry.cs
  54. +1,550 −0 PSReadLine/Prediction.Views.cs
  55. +518 −0 PSReadLine/Prediction.cs
  56. +14 −0 PSReadLine/Properties/launchSettings.json
  57. +11 −1 PSReadLine/PublicAPI.cs
  58. +162 −105 PSReadLine/ReadLine.cs
  59. +294 −150 PSReadLine/ReadLine.vi.cs
  60. +219 −0 PSReadLine/Render.Helper.cs
  61. +714 −235 PSReadLine/Render.cs
  62. +36 −10 PSReadLine/Replace.vi.cs
  63. +146 −18 PSReadLine/SamplePSReadLineProfile.ps1
  64. +78 −0 PSReadLine/StringBuilderCharacterExtensions.cs
  65. +104 −0 PSReadLine/StringBuilderLinewiseExtensions.cs
  66. +113 −0 PSReadLine/StringBuilderTextObjectExtensions.cs
  67. +181 −0 PSReadLine/TextObjects.Vi.cs
  68. +145 −19 PSReadLine/UndoRedo.cs
  69. +19 −19 PSReadLine/ViRegister.cs
  70. +1 −2 PSReadLine/Words.cs
  71. +3 −4 PSReadLine/Words.vi.cs
  72. +44 −22 PSReadLine/YankPaste.vi.cs
  73. +232 −0 Polyfill/CommandPrediction.cs
  74. +22 −0 Polyfill/Polyfill.csproj
  75. +64 −100 README.md
  76. +6 −6 appveyor.yml
  77. +0 −29 az-ci/azure-devops-psreadline.yml
  78. +0 −16 az-ci/azure-pipelines.yml
  79. +36 −32 build.ps1
  80. +0 −82 docs/Get-PSReadLineKeyHandler.md
  81. +0 −47 docs/Get-PSReadLineOption.md
  82. +0 −189 docs/Set-PSReadLineKeyHandler.md
  83. +0 −628 docs/Set-PSReadLineOption.md
  84. +0 −179 docs/about_PSReadLine.help.txt
  85. +4 −3 nuget.config
  86. +371 −48 test/BasicEditingTest.VI.cs
  87. +94 −3 test/BasicEditingTest.cs
  88. +1,291 −2 test/CompletionTest.cs
  89. +450 −0 test/DynamicHelpTest.cs
  90. +135 −19 test/HistoryTest.VI.cs
  91. +321 −4 test/HistoryTest.cs
  92. +821 −0 test/InlinePredictionTest.cs
  93. +1 −1 test/KeyInfo-en-US-windows.json
  94. +593 −4 test/KillYankTest.cs
  95. +2,260 −0 test/ListPredictionTest.cs
  96. +908 −0 test/ListScrollableViewTest.cs
  97. +484 −0 test/ListViewTooltipTest.cs
  98. +223 −42 test/MockConsole.cs
  99. +10 −0 test/MovementTest.VI.Multiline.cs
  100. +58 −12 test/MovementTest.VI.cs
  101. +3 −4 test/MovementTest.cs
  102. +0 −39 test/MultiLineBufferHelperTests.cs
  103. +14 −0 test/OptionsTest.VI.cs
  104. +64 −0 test/OptionsTest.cs
  105. +24 −25 test/PSReadLine.Tests.csproj
  106. +62 −1 test/RenderTest.cs
  107. +186 −0 test/ResizingTest.cs
  108. +46 −0 test/StringBuilderCharacterExtensionsTests.cs
  109. +54 −0 test/StringBuilderLinewiseExtensionsTests.cs
  110. +77 −0 test/StringBuilderTextObjectExtensionsTests.cs
  111. +176 −0 test/TextObjects.Vi.Tests.cs
  112. +55 −3 test/UndoRedoTest.cs
  113. +119 −7 test/UnitTestReadLine.cs
  114. +29 −9 test/ViRegisterTests.cs
  115. +3 −3 test/WordsTests.VI.cs
  116. +64 −6 test/YankPasteTest.VI.cs
  117. +225 −0 test/assets/resizing/physical-line-count.json
  118. +1,008 −0 test/assets/resizing/renderdata-to-cursor-point.json
  119. +0 −13 test/packages.config
  120. +215 −6 tools/CheckHelp.ps1
  121. +0 −213 tools/GenerateFunctionHelp.ps1
  122. +26 −3 tools/helper.psm1
  123. +104 −0 tools/issue-mgmt/CloseDupIssues.ps1
  124. +259 −0 tools/releaseTools.psm1
9 changes: 9 additions & 0 deletions .config/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"instanceUrl": "https://msazure.visualstudio.com",
"projectName": "One",
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell\\PowerShell Core",
"notificationAliases": [
"dongbow@microsoft.com",
"slee@microsoft.com"
]
}
10 changes: 10 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
115 changes: 115 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Contributing to PSReadLine

We welcome and appreciate contributions from the community.
There are many ways to become involved with PSReadLine, including

- Filing issues
- Joining in design conversations
- Writing and improving documentation
- Contributing to the code

Please read the rest of this document to ensure a smooth contribution process.

## Intro to Git and GitHub

* Make sure you have a [GitHub account](https://github.com/signup/free).
* Learning Git:
* GitHub Help: [Good Resources for Learning Git and GitHub][good-git-resources]
* [Git Basics][git-basics]: install and getting started
* [GitHub Flow Guide](https://guides.github.com/introduction/flow/):
step-by-step instructions of GitHub Flow

## Contributor License Agreement (CLA)

To speed up the acceptance of any contribution to any PowerShell repositories,
you should sign the [Microsoft Contributor License Agreement (CLA)][cla] ahead of time.
If you've already contributed to PowerShell or Microsoft repositories in the past, congratulations!
You've already completed this step.
This a one-time requirement for the PowerShell projects.
Signing the CLA process is simple and can be done in less than a minute.
You don't have to do this up-front.
You can simply clone, fork, and submit your pull request as usual.
When your pull request is created, it is checked by the CLA bot.
If you have signed the CLA, the status check will be set to `passing`. Otherwise, it will stay at `pending`.
Once you sign a CLA, all your existing and future pull requests will have the status check automatically set at `passing`.

## Contributing to Issues

* Check if the issue you are going to file already exists in our [GitHub issues][open-issue].
* If you can't find your issue already,
[open a new issue](https://github.com/PowerShell/PSReadLine/issues/new/choose),
making sure to follow the directions as best you can.
* If the issue is marked as [Up-for-Grabs][up-for-grabs],
the PSReadLine Maintainers are looking for help with the issue.

## Contributing to Documentation

The documentation is located in the [docs][psreadline-docs] folder.
The markdown files there are converted to the PowerShell `help.xml` file via [platyPS][platy-ps] during the build.

## Contributing to Code

### Forks and Pull Requests

GitHub fosters collaboration through the notion of [pull requests][using-prs].
On GitHub, anyone can [fork][fork-a-repo] an existing repository
into their own user account, where they can make private changes to their fork.
To contribute these changes back into the original repository,
a user simply creates a pull request in order to "request" that the changes be taken "upstream".

Additional references:

* GitHub's guide on [forking](https://guides.github.com/activities/forking/)
* GitHub's guide on [Contributing to Open Source](https://guides.github.com/activities/contributing-to-open-source/#pull-request)
* GitHub's guide on [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/)

### Bootstrap, Build and Test

See the [Building](../README.md#building) section in README for details.

### Submitting Pull Request

* If your change would fix a security vulnerability,
first follow the [vulnerability issue reporting policy][vuln-reporting], before submitting a PR.
* To avoid merge conflicts, make sure your branch is rebased on the `master` branch of this repository.
* Many code changes will require new tests,
so make sure you've added a new test if existing tests do not effectively cover the code changed.
* If your change adds a new source file, ensure the appropriate copyright and license headers is on top.
It is standard practice to have both a copyright and license notice for each source file.
* For `.cs` files use the copyright header with empty line after it:

```c#
// Copyright (c) Microsoft Corporation.
// Licensed under the 2-Clause BSD License.
<Add empty line here>
```

* For `.ps1` files use the copyright header with empty line after it:

```powershell
# Copyright (c) Microsoft Corporation.
# Licensed under the 2-Clause BSD License.
<Add empty line here>
```
* If you're contributing in a way that changes the user or developer experience, you are expected to document those changes.
* When you create a pull request,
use a meaningful title for the PR describing what change you want to check in.
Make sure you also include a summary about your changes in the PR description.
The description is used to create change logs,
so try to have the first sentence explain the benefit to end users.
If the changes are related to an existing GitHub issue,
please reference the issue in the PR description (e.g. ```Fix #11```).
See [this][closing-via-message] for more details.


[up-for-grabs]: https://github.com/PowerShell/PSReadLine/issues?q=is%3Aopen+is%3Aissue+label%3AUp-for-Grabs
[good-git-resources]: https://help.github.com/articles/good-resources-for-learning-git-and-github/
[git-basics]: https://github.com/PowerShell/PowerShell/blob/master/docs/git/basics.md
[cla]: https://cla.microsoft.com/
[open-issue]: https://github.com/PowerShell/PSReadLine/issues
[psreadline-docs]: https://github.com/PowerShell/PSReadLine/tree/master/docs
[platy-ps]: https://www.powershellgallery.com/packages/platyPS
[using-prs]: https://help.github.com/articles/using-pull-requests/
[fork-a-repo]: https://help.github.com/articles/fork-a-repo/
[vuln-reporting]: SECURITY.md
[closing-via-message]: https://help.github.com/articles/closing-issues-via-commit-messages/
55 changes: 41 additions & 14 deletions .github/ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE/Bug_Report.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
---
name: "Bug report 🐛"
about: Report errors or unexpected behaviors 🤔
title: ''
labels: ''
assignees: ''

---

<!--
Before submitting your bug report, please check for duplicates, and +1 the duplicate if you find one, adding additional details if you have any to add.
There are a few common issues that are commonly reported.
Before submitting your bug report ...
- Please make sure you are able to reproduce the issue with the latest version of PSReadLine.
- Please check for duplicates. +1 the duplicate if you find one and add additional details if you have any.
The maintainer may close your issue without further explanation or engagement if:
- You delete this entire template and go your own path;
- You file an issue that has many duplicates;
- You file an issue completely blank in the body.
If there is an exception copying to/from the clipboard, it's probably the same as https://github.com/PowerShell/PSReadLine/issues/265
If there is an exception shortly after resizing the console, it's probably the same as https://github.com/PowerShell/PSReadLine/issues/292
-->

Environment data
----------------
## Environment

```none
[run the script below and paste the output here]
```

<!--
The following script will generate the environment data that helps triage and investigate the issue.
Please run the script in the PowerShell session where you ran into the issue and provide the output here.
Please run the script in the PowerShell session where you ran into the issue and provide the output above.
& {
$hostName = $Host.Name
@@ -30,11 +46,9 @@ Please run the script in the PowerShell session where you ran into the issue and
}
"`nPS version: $($PSVersionTable.PSVersion)"
$v = (Get-Module PSReadline).Version
$m = Get-Content "$(Split-Path -Parent (Get-Module PSReadLine).Path)\PSReadLine.psd1" | Select-String "Prerelease = '(.*)'"
if ($m) {
$v = "$v-" + $m.Matches[0].Groups[1].Value
}
$m = Get-Module PSReadline
$v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
if ($pre) { $v = "$v-$pre" }
"PSReadline version: $v"
if ($IsLinux -or $IsMacOS) {
"os: $(uname -a)"
@@ -49,5 +63,18 @@ Please run the script in the PowerShell session where you ran into the issue and
-->

Steps to reproduce or exception report
--------------------------------------
## Exception report

<!-- Copy and paste the keys and the exception stack trace printed by PSReadLine, if there is any -->

## Steps to reproduce

<!-- A description of how to trigger this bug. -->

## Expected behavior

<!-- A description of what you're expecting, possibly containing screenshots or reference material. -->

## Actual behavior

<!-- What's actually happening? -->
102 changes: 102 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_Report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Bug report 🐛
description: Report errors or unexpected behavior 🤔
labels: Needs-Triage
body:
- type: checkboxes
attributes:
label: Prerequisites
options:
- label: Write a descriptive title.
required: true
- label: Make sure you are able to repro it on the [latest released version](https://www.powershellgallery.com/packages/PSReadLine)
required: true
- label: Search the existing issues, especially the pinned issues.
required: true
- type: textarea
attributes:
label: Exception report
description: |
Copy and paste the **COMPLETE** exception report message generated by PSReadLine.
If no exception report was involved, simply put "N/A" below.
render: console
placeholder: Oops, something went wrong ...
validations:
required: true
- type: textarea
attributes:
label: Screenshot
description: |
- In case of an exception, **DO NOT take screenshot of the exception report**!
Instead, please scroll up to above the exception report, and take a screenshot of the console state right before the exception happened.
Also, please keep your terminal window size unchanged when taking screenshot.
- If no exception was involved, please upload images or animations that you think may be helpful, or put "N/A" below.
validations:
required: true
- type: textarea
attributes:
label: Environment data
description: |
The following script will generate the environment data that helps triage and investigate the issue.
Please run the script in the PowerShell session where you ran into the issue, and paste the verbatim output below.
```powershell
& {
$hostName = $Host.Name
if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
$id = $PID; $inWindowsTerminal = $false
while ($true) {
$p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
if (!$p -or !$p.Name) { break }
if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
$id = $p.ParentProcessId
}
if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
}
$m = Get-Module PSReadline
$v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
if ($pre) { $v = "$v-$pre" }
$os = if ($IsLinux -or $IsMacOS) { uname -a } else { (dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion }
Write-Host ''
Write-Host "PS Version: $($PSVersionTable.PSVersion)"
Write-Host "PS HostName: $hostName"
Write-Host "PSReadLine Version: $v"
Write-Host "PSReadLine EditMode: $((Get-PSReadLineOption).EditMode)"
Write-Host "OS: $os"
Write-Host "BufferWidth: $([console]::BufferWidth)"
Write-Host "BufferHeight: $([console]::BufferHeight)"
Write-Host ''
}
```
render: console
placeholder: |
PS Version: ...
PS HostName: ...
PSReadLine Version: ...
PSReadLine EditMode: ...
OS: ...
BufferWidth: ...
BufferHeight: ...
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: |
List of steps or sample code to reproduce the issue.
placeholder: |
A description of how to trigger the issue.
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
placeholder: No exception ...
validations:
required: true
- type: textarea
attributes:
label: Actual behavior
placeholder: The above exception happens ...
validations:
required: true
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/Documentation_Issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Documentation Issue 📚
description: Report documentation issues at https://github.com/MicrosoftDocs/PowerShell-Docs/issues/new/choose
labels: Issue-Docs
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this documentation Issue!
Documents for PSReadLine are hosted in the [PowerShell-Docs](https://github.com/MicrosoftDocs/PowerShell-Docs) repo. So, please submit the issue directly in that repo for a quicker response and fix.
- type: checkboxes
attributes:
label: Prerequisites
options:
- label: Write a descriptive title.
required: true
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_Request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature Request or Idea 🚀
description: Suggest a new feature or improvement.
labels: Issue-Enhancement
body:
- type: checkboxes
attributes:
label: Prerequisites
options:
- label: Write a descriptive title.
required: true
- type: textarea
attributes:
label: Description of the new feature/enhancement
description: |
A clear and concise description of what the problem is that the new feature would solve.
Describe why and how a user would use this new functionality (if applicable).
validations:
required: true
- type: textarea
attributes:
label: Proposed technical implementation details (optional)
description: |
A clear and concise description of how you want it to happen.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

<!-- Summarize your PR between here and the checklist. -->

## PR Checklist

- [ ] PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- [ ] Summarized changes
- [ ] Make sure you've added one or more new tests
- [ ] Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
- **User-facing changes**
- [ ] Not Applicable
- **OR**
- [ ] Documentation needed at [PowerShell-Docs](https://github.com/MicrosoftDocs/PowerShell-Docs)
- [ ] Doc Issue filed: <!-- Number/link of that issue here -->
Loading