From 4dc2f416ecf70ae629960dee46b907da303ae88e Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 1 Mar 2024 21:42:03 +0900 Subject: [PATCH] Fix uniq key --- README.md | 2 +- fzf-history.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 964fd85..4b39029 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ And this ```pwsh function Get-History-Fzf([String]$line) { - [Microsoft.PowerShell.PSConsoleReadLine]::GetHistoryItems() | ForEach-Object {$_.CommandLine.ToString()} | Select-String "." | Sort-Object ToString | Get-Unique | Sort-Object LineNumber -Descending | fzf --scheme=history --no-sort --query=$line + [Microsoft.PowerShell.PSConsoleReadLine]::GetHistoryItems() | ForEach-Object {$_.CommandLine.ToString()} | Select-String "." | Sort-Object | Get-Unique | Sort-Object LineNumber -Descending | fzf --scheme=history --no-sort --query=$line } Set-PSReadLineKeyHandler -Chord Ctrl+r -ScriptBlock { diff --git a/fzf-history.ps1 b/fzf-history.ps1 index 56d6eb3..7110959 100644 --- a/fzf-history.ps1 +++ b/fzf-history.ps1 @@ -1,3 +1,3 @@ function Get-History-Fzf([String]$line) { - [Microsoft.PowerShell.PSConsoleReadLine]::GetHistoryItems() | ForEach-Object {$_.CommandLine.ToString()} | Select-String "." | Sort-Object ToString | Get-Unique | Sort-Object LineNumber -Descending | fzf --scheme=history --no-sort --query=$line + [Microsoft.PowerShell.PSConsoleReadLine]::GetHistoryItems() | ForEach-Object {$_.CommandLine.ToString()} | Select-String "." | Sort-Object | Get-Unique | Sort-Object LineNumber -Descending | fzf --scheme=history --no-sort --query=$line }