jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.37k stars 221 forks source link

shell level too high after applying `eval "$(rtx activate zsh)"` #1291

Open ifraixedes opened 6 months ago

ifraixedes commented 6 months ago

Describe the bug

I use zsh, but I have a shell script that uses Bash and the only thing it does is call ledger-cli with some command line arguments.

The script works fine, but if I execute eval "$(rtx activate zsh)" then the script gets stuck and shows /bin/bash: warning: shell level (1000) too high, resetting to 1

I tried to change the script to use zsh and sh, but it gets also stuck, however, it doesn't show the warning.

To Reproduce

In my machine (Manjaro Linux X64) whatever ledger command gets stuck. I can reproduce it if I run the commented eval and run ledger -h, so there isn't any need to run it through any shell script to see the ledger gets stuck, however, the commented warning doesn't prompt if it isn't executed by a shell script.

Expected behavior

ledger shouldn't get stuck

rtx doctor output

rtx version:
  2023.12.40 linux-x64 (460e547 2023-12-28)

build:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Thu, 28 Dec 2023 15:30:24 +0000
  Rust Version: rustc 1.74.1 (a28077b28 2023-12-04)
  Profile: release

shell:
  /usr/bin/zsh
  zsh 5.9 (x86_64-pc-linux-gnu)

rtx data directory:
  /home/ivan/.local/share/rtx

rtx environment variables:
  RTX_SHELL=zsh

settings:
  {
    "experimental": false,
    "color": true,
    "always_keep_download": false,
    "always_keep_install": false,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "plugin_autoupdate_last_check_duration": "7d",
    "trusted_config_paths": [],
    "log_level": "info",
    "trace": false,
    "debug": false,
    "verbose": false,
    "quiet": false,
    "asdf_compat": false,
    "jobs": 4,
    "shorthands_file": null,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "raw": false,
    "yes": false,
    "task_output": null,
    "not_found_auto_install": true,
    "ci": false
  }

config files:
  /home/ivan/.config/rtx/config.toml

plugins:
  bun      (core)
  deno     (core)
  go       (core)
  java     (core)
  node     (core)
  python   (core)
  ruby     (core)

toolset:
  node@latest, go@latest

No problems found

Content of ~/.config/rtx/config.toml

[tools]
node = "latest"
go = "latest"

Additional context

jdx commented 6 months ago

Not sure, I'll have to debug this a bit but can you try disabling this since I suspect it might be related https://github.com/jdx/rtx#rtx_not_found_auto_installtrue

ifraixedes commented 6 months ago

I disabled it right before I posted the issue. No rush from my side.

Thank you for looking at it.