Fix error messages in Xonsh

This commit is contained in:
Ajeet D'Souza 2021-10-05 02:42:27 +05:30
parent 917663485f
commit 62305aead6
3 changed files with 15 additions and 2 deletions

View File

@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Nushell: upgrade minimum supported version to v0.37.0.
### Fixed
- Xonsh: error messages in `zi`.
- Xonsh: configuration environment variables not being handled correctly.
## [0.7.5] - 2020-09-09
### Added

View File

@ -328,6 +328,7 @@ They must be set before `zoxide init` is called.
| [ranger] | File manager | [ranger-zoxide] |
| [telescope.nvim] | Fuzzy finder for Neovim | [telescope-zoxide] |
| [vim] | Text editor | [zoxide.vim] |
| [xplr] | File manager | [zoxide.xplr] |
| [xxh] | Transports shell configuration over SSH | [xxh-plugin-prerun-zoxide] |
| [zsh-autocomplete] | Realtime completions for zsh | Supported by default |
@ -375,8 +376,10 @@ They must be set before `zoxide init` is called.
[vim]: https://github.com/vim/vim
[void linux packages]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zoxide
[wiki-env]: https://github.com/ajeetdsouza/zoxide/wiki/HOWTO:-set-environment-variables "HOWTO: set environment variables"
[xplr]: https://github.com/sayanarijit/xplr
[xxh-plugin-prerun-zoxide]: https://github.com/xxh/xxh-plugin-prerun-zoxide
[xxh]: https://github.com/xxh/xxh
[zoxide.el]: https://gitlab.com/Vonfry/zoxide.el
[zoxide.vim]: https://github.com/nanotee/zoxide.vim
[zoxide.xplr]: https://github.com/sayanarijit/zoxide.xplr
[zsh-autocomplete]: https://github.com/marlonrichert/zsh-autocomplete

View File

@ -93,7 +93,7 @@ if "__zoxide_hook" not in globals():
"""Hook to add new entries to the database."""
pwd = __zoxide_pwd()
zoxide = __zoxide_bin()
subprocess.run([zoxide, "add", "--", pwd], check=False)
subprocess.run([zoxide, "add", "--", pwd], check=False, env=builtins.__xonsh__.env.detype())
{% endif -%}
@ -119,6 +119,7 @@ def __zoxide_z(args: List[str]):
cmd = subprocess.run(
[zoxide, "query", "--exclude", __zoxide_pwd(), "--"] + args,
check=True,
env=builtins.__xonsh__.env.detype(),
stdout=subprocess.PIPE,
)
except subprocess.CalledProcessError as exc:
@ -128,12 +129,16 @@ def __zoxide_z(args: List[str]):
__zoxide_cd(result)
@__zoxide_errhandler
def __zoxide_zi(args: List[str]):
"""Jump to a directory using interactive search."""
try:
zoxide = __zoxide_bin()
cmd = subprocess.run(
[zoxide, "query", "-i", "--"] + args, check=True, stdout=subprocess.PIPE
[zoxide, "query", "-i", "--"] + args,
check=True,
env=builtins.__xonsh__.env.detype(),
stdout=subprocess.PIPE
)
except subprocess.CalledProcessError as exc:
raise ZoxideSilentException() from exc