Compare commits

...

5 Commits

Author SHA1 Message Date
Sandro 702125989c
Merge d28af07786 into 194f8e31e4 2025-10-06 16:15:32 -07:00
Ajeet D'Souza 194f8e31e4
Update README.md 2025-10-03 02:59:45 +05:30
Ajeet D'Souza eb7b08fed3
Update README.md 2025-09-30 18:34:43 +05:30
Sandro Jäckel d28af07786
Fix linting 2025-04-09 14:16:28 +02:00
Sandro a88bb34387
Don't downcast PROMPT_COMMAND
Since bash 5.0 PROMPT_COMMAND is an array. Lets not turn it into a string.
Copied from https://github.com/direnv/direnv/blob/master/internal/cmd/shell_bash.go#L19-L23
2025-04-08 15:13:35 +02:00
2 changed files with 7 additions and 3 deletions

View File

@ -12,12 +12,12 @@
<sup>Special thanks to:</sup>
<!-- markdownlint-disable-next-line MD013 -->
<div><img alt="Sponsored by Warp" width="230" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-03.png" /></div>
<div><a href="https://go.warp.dev/zoxide"><img alt="Sponsored by Warp" width="230" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-03.png" /></a></div>
<div><sup><b>Warp, built for coding with multiple AI agents.</b></sup></div>
<div><sup>Available for macOS, Linux, and Windows.</sup></div>
<div><sup>
Visit
<a href="https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=zoxide_20231001"><u>warp.dev</u></a>
<a href="https://go.warp.dev/zoxide"><u>warp.dev</u></a>
to learn more.
</sup></div>

View File

@ -55,7 +55,11 @@ function __zoxide_hook() {
# Initialize hook.
if [[ ${PROMPT_COMMAND:=} != *'__zoxide_hook'* ]]; then
PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND#;}"
if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then
PROMPT_COMMAND=(__zoxide_hook "${PROMPT_COMMAND[@]}")
else
PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND#;}"
fi
fi
{%- endif %}