Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,35 @@ jobs:
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/windows-suggestions-smoke.ps1 -DgoBin (Resolve-Path target/release/dgo.exe)
- name: PowerShell native predictor version matrix
if: runner.os == 'Windows'
shell: pwsh
run: |
$releases = @(
@{ Version = '7.4.19'; Sha256 = 'CD62AD6D8174CC6FB85B335A0058444BC934FE27C39FA97FE342134286D28AF9' },
@{ Version = '7.5.10'; Sha256 = '680D8CA69C5514D0BD4496AC6E94391155B4C71E97223BBDE28A0E5230C20979' },
@{ Version = '7.6.4'; Sha256 = '80832551C52809301E6071C8BAC977BEB5A2F1EC953EB4DB9F94DEB953333793' }
)
foreach ($release in $releases) {
$archive = Join-Path $env:RUNNER_TEMP "PowerShell-$($release.Version)-win-x64.zip"
$destination = Join-Path $env:RUNNER_TEMP "PowerShell-$($release.Version)"
$uri = "https://github.com/PowerShell/PowerShell/releases/download/v$($release.Version)/PowerShell-$($release.Version)-win-x64.zip"
Invoke-WebRequest -Uri $uri -OutFile $archive
$actualHash = (Get-FileHash -Algorithm SHA256 $archive).Hash
if ($actualHash -ne $release.Sha256) {
throw "PowerShell $($release.Version) archive checksum mismatch"
}
Expand-Archive -LiteralPath $archive -DestinationPath $destination
$pwsh = Join-Path $destination 'pwsh.exe'
$actualVersion = & $pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
if ($actualVersion -ne $release.Version) {
throw "Expected PowerShell $($release.Version), found $actualVersion"
}
& $pwsh -NoLogo -NoProfile -File ./scripts/windows-suggestions-smoke.ps1 -DgoBin (Resolve-Path target/release/dgo.exe) -RequireNativePredictor
if ($LASTEXITCODE -ne 0) {
throw "PowerShell $($release.Version) suggestions smoke failed"
}
}
- name: Verify Linux glibc compatibility baseline
if: runner.os == 'Linux'
run: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes follow Keep a Changelog and Semantic Versioning.

## [Unreleased]

## [0.8.4] - 2026-09-09

### Fixed

- Enable the native Dirgo predictor on supported PowerShell releases newer than 7.4, including PowerShell 7.5 and 7.6, instead of rejecting every minor version other than 7.4.
- Exercise the native prediction path on any PowerShell 7.4+ Windows runner so future LTS upgrades cannot silently disable suggestions.
- Keep PowerShell profile startup quiet when PSReadLine refuses prediction UI settings for redirected or non-interactive output; the registered predictor and `Ctrl+F` fallback remain available.

## [0.8.3] - 2026-09-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dirgo"
version = "0.8.3"
version = "0.8.4"
default-run = "dgo"
edition = "2024"
rust-version = "1.89"
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ match the installed binary.
</p>

- **Zsh:** responsive paged panel with descriptions and `Tab` insertion.
- **PowerShell 7.4.x:** native PSReadLine ListView prediction.
- **PowerShell 7.4+:** native PSReadLine ListView prediction.
- **Fish and Bash 4+:** enriched native `Tab` completion.
- **Every supported shell:** `Ctrl+F` inserts the best result and `Shift+Tab`
opens the explicit source-labelled picker.
Expand Down Expand Up @@ -526,7 +526,7 @@ each keystroke.
| macOS Apple Silicon | Homebrew, installer, archive | Zsh, Bash, Fish |
| macOS Intel | Installer, archive | Zsh, Bash, Fish |
| Linux x86_64 GNU | Installer, archive; glibc 2.35+ | Zsh, Bash, Fish |
| Windows x86_64 MSVC | PowerShell installer, Scoop, archive | PowerShell 7+; native predictor on 7.4.x |
| Windows x86_64 MSVC | PowerShell installer, Scoop, archive | PowerShell 7+; native predictor on 7.4+ |

WSL uses its Zsh, Bash, or Fish adapter.

Expand Down Expand Up @@ -567,7 +567,8 @@ Report vulnerabilities privately through [SECURITY.md](SECURITY.md).

| Version | Status | User-visible scope |
| --- | --- | --- |
| **0.8.3** | Current stable release | Self-contained Windows installation, fresh interactive update checks, local Workflow Intelligence, and Workspace Palette. |
| **0.8.4** | Current stable release | Native suggestions on current PowerShell 7 releases, including 7.5 and 7.6. |
| **0.8.3** | Previous stable release | Self-contained Windows installation, fresh interactive update checks, local Workflow Intelligence, and Workspace Palette. |
| **0.8.2** | Previous stable release | Windows user-level installation, fresh interactive update checks, local Workflow Intelligence, and Workspace Palette. |
| **0.7.1** | Previous stable release | Workspace Palette, focused roots, ordered path search, bounded lazy previews, safe source switching, cached update awareness, and easier Windows installation. |
| **0.6.0** | Previous stable release | Opt-in completed-command context, schema v2 migration, project/success-aware ranking, scoped inspection, clearing, and privacy-preserving export. |
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/suggestions.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pruned to 64 projects.
| Zsh | Full automatic live panel through `zle-line-pre-redraw`, anchored after the editable buffer with `POSTDISPLAY`; existing widgets and keymaps are preserved |
| Fish | Built-in live autosuggestion plus its native completion pager; Dirgo enriches candidates without replacing Fish's editor |
| Bash 4+ | Context-complete explicit list and insertion through Readline; no per-character key rebinding |
| PowerShell 7+ | `Ctrl+F` insertion; PowerShell 7.4.x gets automatic native PSReadLine `ListView` prediction |
| PowerShell 7+ | `Ctrl+F` insertion; PowerShell 7.4+ gets automatic native PSReadLine `ListView` prediction |

WSL uses the corresponding Linux shell adapter. Windows PowerShell 5.1 and
`cmd.exe` are not supported.
Expand Down
2 changes: 1 addition & 1 deletion packaging/scoop/dirgo.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"notes": [
"Run 'dgo setup' from PowerShell 7+ to enable parent-shell navigation and safe suggestions.",
"Native inline and list prediction is available on PowerShell 7.4.x with PSReadLine 2.2.2+."
"Native inline and list prediction is available on PowerShell 7.4+ with PSReadLine 2.2.2+."
],
"architecture": {
"64bit": {
Expand Down
2 changes: 1 addition & 1 deletion powershell/DirgoPredictor/DirgoPredictor.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'DirgoPredictor.dll'
ModuleVersion = '0.8.3'
ModuleVersion = '0.8.4'
GUID = '531a90d6-192f-46c7-94cb-2c81413eed9b'
Author = 'Dirgo contributors'
CompanyName = 'Dirgo'
Expand Down
13 changes: 11 additions & 2 deletions scripts/windows-suggestions-smoke.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
param(
[Parameter(Mandatory = $true)]
[string]$DgoBin
[string]$DgoBin,
[switch]$RequireNativePredictor
)

$ErrorActionPreference = 'Stop'
Expand Down Expand Up @@ -41,10 +42,15 @@ try {
$handler = Get-PSReadLineKeyHandler -Chord Ctrl+f
if ($handler.Function -ne 'DirgoSuggestion') { throw 'Ctrl+f suggestion handler is missing' }
}
$psReadLineVersion = (Get-Module -ListAvailable PSReadLine | Sort-Object Version -Descending | Select-Object -First 1).Version
if ($RequireNativePredictor -and $psReadLineVersion -lt [version]'2.2.2') {
throw "native predictor smoke requires PSReadLine 2.2.2+, found $psReadLineVersion"
}
$dirgoPredictorRegistered = $false
$version = (& $DgoBin --version) -replace '^dgo\s+', ''
$manifest = Join-Path (Split-Path -Parent $DgoBin) "DirgoPredictor/$version/DirgoPredictor.psd1"
if ($PSVersionTable.PSVersion.Major -eq 7 -and
$PSVersionTable.PSVersion.Minor -eq 4 -and
$PSVersionTable.PSVersion -ge [version]'7.4.0' -and
(Test-Path -LiteralPath $manifest)) {
$predictors = [System.Management.Automation.Subsystem.SubsystemManager]::GetSubsystemInfo(
[System.Management.Automation.Subsystem.SubsystemKind]::CommandPredictor).Implementations
Expand Down Expand Up @@ -73,6 +79,9 @@ try {
return $result
}
}
if ($RequireNativePredictor -and -not $dirgoPredictorRegistered) {
throw "Dirgo predictor was not registered on PowerShell $($PSVersionTable.PSVersion)"
}

Set-Location -LiteralPath $root
$replacement = Invoke-DirgoSuggestion -BeforeCursor 'Set-Location pun' -AfterCursor ''
Expand Down
31 changes: 28 additions & 3 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ if ($suggestionsEnabled -and (Get-Module -ListAvailable PSReadLine)) {
$nativeCompletionsEnabled = $LASTEXITCODE -eq 0
if ($nativeCompletionsEnabled -and
$PSVersionTable.PSVersion.Major -eq 7 -and
$PSVersionTable.PSVersion.Minor -eq 4 -and
$PSVersionTable.PSVersion -ge [version]'7.4.0' -and
$psReadLineVersion -ge [version]'2.2.2' -and
(Test-Path -LiteralPath $predictorManifest)) {
Import-Module $predictorManifest -ErrorAction SilentlyContinue
Expand All @@ -1325,8 +1325,13 @@ if ($suggestionsEnabled -and (Get-Module -ListAvailable PSReadLine)) {
if ($predictorSubsystem.Implementations.Name -contains 'Dirgo' -and
$Host.UI.SupportsVirtualTerminal) {
$dirgoPredictorRegistered = $true
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
try {
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -ErrorAction Stop
Set-PSReadLineOption -PredictionViewStyle ListView -ErrorAction Stop
} catch {
# PSReadLine can reject prediction UI settings when output is redirected.
# The predictor remains registered and Ctrl+F remains available.
}
}
}

Expand Down Expand Up @@ -1574,6 +1579,26 @@ mod tests {
assert!(!script.contains("AcceptLine"));
}

#[test]
fn powershell_predictor_accepts_supported_7x_versions_after_7_4() {
let script = integration(Shell::PowerShell);
assert!(script.contains("$PSVersionTable.PSVersion.Major -eq 7"));
assert!(script.contains("$PSVersionTable.PSVersion -ge [version]'7.4.0'"));
assert!(!script.contains("$PSVersionTable.PSVersion.Minor -eq 4"));
assert!(
script.contains(
"Set-PSReadLineOption -PredictionSource HistoryAndPlugin -ErrorAction Stop"
)
);
assert!(
script.contains("Set-PSReadLineOption -PredictionViewStyle ListView -ErrorAction Stop")
);
assert!(
script
.contains("PSReadLine can reject prediction UI settings when output is redirected")
);
}

#[test]
fn history_adapters_capture_completed_command_context_without_debug_traps() {
let zsh = integration(Shell::Zsh);
Expand Down