GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add built-in PowerShell shell completion support by doctorlai-msrc · Pull Request #3637 · pallets/click

Conversation

@doctorlai-msrc

@doctorlai-msrc doctorlai-msrc commented Jun 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Adds PowerShellComplete as a fourth built-in shell completer, alongside the
existing BashComplete, ZshComplete, and FishComplete. Users of Click-based
CLIs on Windows PowerShell 5.1+ or PowerShell (pwsh) 7+ can now opt into TAB
completion the same way they do for the other shells:

# In $PROFILE
$env:_FOO_BAR_COMPLETE = 'powershell_source'
foo-bar | Out-String | Invoke-Expression
Remove-Item Env:_FOO_BAR_COMPLETE

…or generate the script once and source it:

$env:_FOO_BAR_COMPLETE = 'powershell_source'
foo-bar | Out-File -Encoding utf8 ~/.foo-bar-complete.ps1
Remove-Item Env:_FOO_BAR_COMPLETE
# then in $PROFILE:
. ~/.foo-bar-complete.ps1

PowerShell support has been a long-standing gap in Click; downstream projects
have repeatedly worked around it by shipping ad-hoc completer scripts. This PR
makes it a first-class built-in so every Click-based CLI gets it for free.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
doctorlai-msrc added 2 commits June 26, 2026 11:32
@doctorlai-msrc
Add built-in PowerShell shell completion support
27b3ee2
@doctorlai-msrc
Fix ruff E501 line-too-long in PowerShell template
1ac08db
@davidism davidism closed this Jun 26, 2026
@davidism davidism reopened this Jun 26, 2026
@Rowlando13

Rowlando13 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Thanks for the nice pr, but we can't accept it. We don't have any tests for the current shells so it is very hard to maintain them. It's a known issue that we are working toward fixing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Rowlando13

Rowlando13 commented Jul 1, 2026

Copy link
Copy Markdown
Member

@davidism do you agree?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davidism

davidism commented Jul 1, 2026 •
edited by kdeldycke
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

I honestly don't know how we'd test the shell completion at the shell level. I'm not particularly concerned about that, we have bash, zsh, and fish, there have been some bugs and fixes over time, and things just keep working. I'm fine with some manual testing on a Windows machine/VM, then merging this in and letting it develop from there. You could also compare to the existing (no longer compatible) implementation in click-completion, and try to understand the implementation by looking at powershell docs as a quick spot check.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke

kdeldycke commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Yeah, I'm also OK with merging an MVP PowerShell completion. It's not worse than the other shell completion so we can rely on fixes and patches from the community for a while, while we search for a solution for better interactive tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke kdeldycke added shell completion Shell tab completion windows Windows-specific behavior labels Jul 1, 2026
@kdeldycke kdeldycke added this to the 8.5.0 milestone Jul 1, 2026
@kdeldycke
kdeldycke changed the base branch from main to stable July 1, 2026 04:23
@kdeldycke
kdeldycke changed the base branch from stable to main July 1, 2026 04:55
@doctorlai-msrc
Merge remote-tracking branch 'origin/main' into zhihua/powershell
cbc6765
# Conflicts:
#	src/click/shell_completion.py
@Rowlando13

Rowlando13 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Does anyone else have windows to test this? If not, I can check.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Rowlando13 Rowlando13 modified the milestones: 8.5.0, 9.0.0 Jul 8, 2026
@kdeldycke

kdeldycke commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Given #3676 , I guess the milestone change to 9.0.0 is just the blast radius of the recent main <-> stable dance. So I retarget this to 8.5.0 unless an explicit decision is made.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke kdeldycke modified the milestones: 9.0.0, 8.5.0 Jul 8, 2026
@Rowlando13

Rowlando13 commented Jul 16, 2026

Copy link
Copy Markdown
Member

@kdeldycke Tested basic functionality on my windows machine. Hitting merge. Thanks @doctorlai-msrc ! We will ping you in when bugs come in.

DoctorLai reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Rowlando13
Rowlando13 merged commit 7df2f82 into pallets:main Jul 16, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke

kdeldycke commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@kdeldycke Tested basic functionality on my windows machine. Hitting merge. Thanks @doctorlai-msrc ! We will ping you in when bugs come in.

Cool! Again, no objection to merge this, it is not worse in term of test coverage than the other shells, so we will see how the community is going to stumble upon edge-cases.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke kdeldycke linked an issue Jul 17, 2026 that may be closed by this pull request
Add support for powershell/cmd tab completions for windows #2672
Closed
This was referenced Jul 17, 2026
Add support for powershell/cmd tab completions for windows #2672
Closed
Pre-8.5.0 release changelog and doc fixes #3697
Merged
kdeldycke added a commit to kdeldycke/click that referenced this pull request Jul 17, 2026
@kdeldycke
Add missing references in changelog
5948803
Refs pallets#3637
kdeldycke added a commit to kdeldycke/click that referenced this pull request Jul 17, 2026
@kdeldycke
Add missing references in changelog
8855a4d
Refs pallets#3637
kdeldycke added a commit to kdeldycke/click that referenced this pull request Jul 17, 2026
@kdeldycke
Add missing references in changelog
953f1a5
Refs pallets#3637
kdeldycke added a commit to kdeldycke/click that referenced this pull request Jul 17, 2026
@kdeldycke
Add missing references in changelog
b4edf0a
Refs pallets#3637
@coderabbitai coderabbitai Bot mentioned this pull request Jul 25, 2026
Add CLI components and supporting logic wlix13/NullForge#5
Merged
6 of 13 tasks
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

shell completion Shell tab completion windows Windows-specific behavior

Projects

None yet

Milestone

8.5.0

Development

Successfully merging this pull request may close these issues.

Add support for powershell/cmd tab completions for windows

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@doctorlai-msrc @Rowlando13 @davidism @kdeldycke
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.