jdx / mise

dev tools, env vars, task runner

Home Page:https://mise.jdx.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad substiution error on activating mise in bash

glenroy37 opened this issue · comments

Describe the bug
When activating Mise with eval "$(~/.local/bin/mise activate bash) in the .bashrc file
I get the output: bash: ${$(declare -f command_not_found_handle)/command_not_found_handle/_command_not_found_handle}: bad substitution on new bash instances.

To Reproduce
Use .bashrc to activate mise, start new bash instance

Expected behavior
No bad substitution error should be thrown. A possible solution could be to replace
[ -n "$(declare -f command_not_found_handle)" ] && eval "${$(declare -f command_not_found_handle)/command_not_found_handle/_command_not_found_handle}"
in the output of mise activate bash with

if [ -n "$(declare -f command_not_found_handle)" ]; then
    _command_not_found_handle=$(declare -f command_not_found_handle | sed 's/command_not_found_handle/_command_not_found_handle/')
    eval "$_command_not_found_handle"
fi

mise doctor output

mise version:
2024.1.33 linux-x64 (1e3afe9 2024-01-30)

build:
Target: x86_64-unknown-linux-gnu
Features: DEFAULT, NATIVE_TLS, OPENSSL
Built: Tue, 30 Jan 2024 19:13:22 +0000
Rust Version: rustc 1.75.0 (82e1608df 2023-12-21)
Profile: release

shell:
/bin/bash
GNU bash, version 5.2.26(1)-release (x86_64-suse-linux)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

mise data directory:
/home/mathias/.local/share/mise

mise environment variables:
MISE_SHELL=bash

settings:
{
"activate_aggressive": false,
"all_compile": false,
"always_keep_download": false,
"always_keep_install": false,
"asdf_compat": false,
"cargo_binstall": true,
"color": true,
"disable_default_shorthands": false,
"disable_tools": [],
"experimental": false,
"jobs": 4,
"legacy_version_file": true,
"legacy_version_file_disable_tools": [],
"node_compile": false,
"not_found_auto_install": true,
"paranoid": false,
"plugin_autoupdate_last_check_duration": "7d",
"python_compile": false,
"python_default_packages_file": "/home/mathias/.default-python-packages",
"python_patch_url": null,
"python_patches_directory": null,
"python_precompiled_arch": null,
"python_precompiled_os": null,
"python_pyenv_repo": "https://github.com/pyenv/pyenv.git",
"python_venv_auto_create": false,
"raw": false,
"shorthands_file": null,
"status": {
"missing_tools": true,
"show_env": false,
"show_tools": false
},
"task_output": null,
"trusted_config_paths": [],
"quiet": false,
"verbose": false,
"yes": false,
"ci": false,
"cd": null,
"debug": false,
"env_file": null,
"trace": false,
"log_level": "info"
}

config files:
~/.tool-versions

plugins:
bun (core)
deno (core)
flutter https://github.com/oae/asdf-flutter.git#d108efd
go (core)
gojq https://github.com/jimmidyson/asdf-gojq.git#34d2ceb
gradle https://github.com/rfrancis/asdf-gradle.git#9a2ca80
java https://github.com/halcyon/asdf-java.git#30c69a6
node https://github.com/rtx-plugins/rtx-nodejs.git#da3fc45
python (core)
ruby https://github.com/rtx-plugins/rtx-ruby.git#203001f
sdkandroid ssh://git@bitbucket.oeamtc.at/com/asdf-android.git#d78fad1
yq https://github.com/sudermanjr/asdf-yq.git#772992f

toolset:
java@openjdk-17, node@lts

No problems found

Additional context