From f1691d22f73abf15d7eef7bd73a626f463d01cef Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 12 Jun 2021 10:48:43 +0800 Subject: [PATCH] [bugfix] fzf unicode / fzf cancelled --- win/Modules/Pass/Pass.psm1 | 9 ++++++++- win/setup/oh-my-posh.ps1 | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/win/Modules/Pass/Pass.psm1 b/win/Modules/Pass/Pass.psm1 index 8896a90..4b6c32a 100644 --- a/win/Modules/Pass/Pass.psm1 +++ b/win/Modules/Pass/Pass.psm1 @@ -32,6 +32,10 @@ function EnsurePath { [String] $PassPath ) + if (!$PassPath) { + throw "path is empty!" + } + $PassPath = Join-Path $PASSWORD_STORE_DIR $PassPath if (!$PassPath.EndsWith(".gpg")) { $PassPath = $PassPath + ".gpg" @@ -60,7 +64,7 @@ function FzfPass { $PASSWORD_STORE_DIR.Length+1, $_.FullName.Length-$PASSWORD_STORE_DIR.Length-5 ) - } | Invoke-Fzf + } | fzf } function Edit-Pass { @@ -71,6 +75,9 @@ function Edit-Pass { if (!$PassPath) { $PassPath = FzfPass + if (!$?) { + return + } } $PassPath = EnsurePath $PassPath diff --git a/win/setup/oh-my-posh.ps1 b/win/setup/oh-my-posh.ps1 index e4d24cb..8afbb42 100644 --- a/win/setup/oh-my-posh.ps1 +++ b/win/setup/oh-my-posh.ps1 @@ -1,7 +1,8 @@ -# curl: https://curl.se/windows/ -# ag: https://github.com/k-takata/the_silver_searcher-win32/releases -# fzf: https://github.com/junegunn/fzf/releases/latest (2.7.2 not working with psfzf) -$PSDefaultParameterValues = @{ "*:Proxy"="http://localhost:8123" } +# curl: https://curl.se/windows/ +# ag: https://github.com/k-takata/the_silver_searcher-win32/releases +# fzf: https://github.com/junegunn/fzf/releases/latest (2.7.2 not working with psfzf) +# utf-8 for i18n: Settings and then: All Settings -> Time & Language -> Language -> "Administrative Language Settings" +$PSDefaultParameterValues = @{ "*:Proxy"="http://localhost:2021" } #Install-Module -Name PowerShellGet -Force -AllowPrerelease Register-PSRepository -Default -InstallationPolicy Trusted Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted