Skip to content

Strange show_env output when redacted variable follows empty variable #4246

Open
@jdx

Description

@jdx

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions