From 62305aead630303b90bf71169c146caf347e8fdb Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 5 Oct 2021 02:42:27 +0530 Subject: [PATCH] Fix error messages in Xonsh --- CHANGELOG.md | 5 +++++ README.md | 3 +++ templates/xonsh.txt | 9 +++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7afd6e5..598a2c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index f9e46e4..3c4d0a5 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/templates/xonsh.txt b/templates/xonsh.txt index 85292b7..ac2551e 100644 --- a/templates/xonsh.txt +++ b/templates/xonsh.txt @@ -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