summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjeet D'Souza <98ajeet@gmail.com>2024-03-16 12:30:19 +0530
committerGitHub <noreply@github.com>2024-03-16 12:30:19 +0530
commit5b2c9222f9737a828438b487d9d8fd37f5bba81b (patch)
tree15de95bae9008c5c421221dd8b8d466c38c960ba
parent88d494fc2dcace7768984a23082ccbcd4a2b7afc (diff)
pwsh: handle queries that look like args (#760)
-rw-r--r--CHANGELOG.md1
-rw-r--r--templates/powershell.txt10
2 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 95e7b78..899316b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- fish: detect infinite loop when using `alias cd=z`.
+- fish / PowerShell: handle queries that look like args (e.g. `z -x`).
## [0.9.4] - 2024-02-21
diff --git a/templates/powershell.txt b/templates/powershell.txt
index 4a23246..86b1966 100644
--- a/templates/powershell.txt
+++ b/templates/powershell.txt
@@ -62,7 +62,7 @@ function global:__zoxide_cd($dir, $literal) {
function global:__zoxide_hook {
$result = __zoxide_pwd
if ($null -ne $result) {
- zoxide add -- $result
+ zoxide add "--" $result
}
}
{%- else if hook == InitHook::Pwd -%}
@@ -72,7 +72,7 @@ function global:__zoxide_hook {
$result = __zoxide_pwd
if ($result -ne $global:__zoxide_oldpwd) {
if ($null -ne $result) {
- zoxide add -- $result
+ zoxide add "--" $result
}
$global:__zoxide_oldpwd = $result
}
@@ -112,10 +112,10 @@ function global:__zoxide_z {
else {
$result = __zoxide_pwd
if ($null -ne $result) {
- $result = __zoxide_bin query --exclude $result -- @args
+ $result = __zoxide_bin query --exclude $result "--" @args
}
else {
- $result = __zoxide_bin query -- @args
+ $result = __zoxide_bin query "--" @args
}
if ($LASTEXITCODE -eq 0) {
__zoxide_cd $result $true
@@ -125,7 +125,7 @@ function global:__zoxide_z {
# Jump to a directory using interactive search.
function global:__zoxide_zi {
- $result = __zoxide_bin query -i -- @args
+ $result = __zoxide_bin query -i "--" @args
if ($LASTEXITCODE -eq 0) {
__zoxide_cd $result $true
}