Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange show_env output when redacted variable follows empty variable #4246

Open
jdx opened this issue Jan 27, 2025 · 1 comment
Open

Strange show_env output when redacted variable follows empty variable #4246

jdx opened this issue Jan 27, 2025 · 1 comment
Labels

Comments

@jdx
Copy link
Owner

jdx commented Jan 27, 2025

Discussed in #4245

Originally posted by majutsushi January 27, 2025
I have this mise.toml file:

[settings]

[settings.status]
show_env = true

[env]
A = "a"
B = { value = "b", redact = true }

This correctly prints out the variables when cd'ing into the directory:

mise +A +B

However, if I make the variable A an empty string like this:

[env]
A = ""
B = { value = "b", redact = true }

then I get this output:

mise [redacted]+[redacted]A[redacted] [redacted]+[redacted]B[redacted]

This only happens if an empty variable if followed by a redacted variable. If I add another variable C = "c" between A and B then the output gets even stranger:

mise [reda[redacted]ted]+[reda[redacted]ted]A[reda[redacted]ted] [reda[redacted]ted]+[reda[redacted]ted]B[reda[redacted]ted] [reda[redacted]ted]+[reda[redacted]ted]C[reda[redacted]ted]

mise doctor output:

version: 2025.1.15 macos-arm64 (2025-01-26)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Sun, 26 Jan 2025 01:57:43 +0000
  Rust Version: rustc 1.84.0 (9fc6b4312 2025-01-07) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (arm64-apple-darwin24.0)

dirs:
  cache: ~/Library/Caches/mise
  config: ~/.config/mise
  data: ~/.local/share/mise
  shims: ~/.local/share/mise/shims
  state: ~/.local/state/mise

config_files:
  ~/.config/mise/config.toml
  ~/Downloads/tmp/mise.toml

ignored_config_files: (none)

backends:
  aqua
  asdf
  cargo
  core
  dotnet
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:

toolset:

path:
  ~/.local/state/zsh/zinit/snippets/https--github.com--bill-auger--git-branch-status--blob--development/git-branch-sta
tus
  ~/.local/state/zsh/zinit/snippets/https--github.com--grawity--treeify--blob--main/treeify
  ~/.local/state/zsh/zinit/snippets/https--github.com--grawity--code--blob--main--misc/xterm-color-chooser
  ~/.local/state/zsh/zinit/plugins/ms-jpq---sad
  ~/.local/state/zsh/zinit/plugins/mikefarah---yq
  ~/.local/state/zsh/zinit/plugins/antonmedv---fx
  ~/.local/state/zsh/zinit/plugins/swsnr---mdcat
  ~/.local/state/zsh/zinit/plugins/PaulJuliusMartinez---jless
  ~/.local/state/zsh/zinit/plugins/Wilfred---difftastic
  ~/.local/state/zsh/zinit/plugins/jesseduffield---lazygit
  ~/.local/state/zsh/zinit/plugins/sxyazi---yazi/yazi-aarch64-apple-darwin
  ~/.local/state/zsh/zinit/plugins/starship---starship
  ~/.bin
  ~/.local/bin
  /opt/homebrew/Cellar/gnu-tar/1.35/libexec/gnubin
  /opt/homebrew/Cellar/gnu-sed/4.9/libexec/gnubin
  /opt/homebrew/Cellar/gawk/5.3.1/libexec/gnubin
  /opt/homebrew/Cellar/gnu-getopt/2.40.4/bin
  /opt/homebrew/Cellar/coreutils/9.6/libexec/gnubin
  /opt/homebrew/bin
  /opt/homebrew/sbin
  /usr/local/bin
  /System/Volumes/Preboot/Cryptexes/App/usr/bin
  /usr/bin
  /bin
  /usr/sbin
  /sbin

env_vars:
  MISE_SHELL=zsh

settings:
  status.show_env  true ~/Downloads/tmp/mise.toml

No problems found
```</div>
@jdx jdx added the bug label Feb 1, 2025
@jdx
Copy link
Owner Author

jdx commented Feb 1, 2025

I think the issue should be obvious, but it's that the "[redaction]" string itself is being redacted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant