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

Bad substiution error on activating mise in bash #1563

Closed
glenroy37 opened this issue Jan 31, 2024 · 0 comments · Fixed by #1564
Closed

Bad substiution error on activating mise in bash #1563

glenroy37 opened this issue Jan 31, 2024 · 0 comments · Fixed by #1564
Labels
bug Something isn't working

Comments

@glenroy37
Copy link

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

@glenroy37 glenroy37 added the bug Something isn't working label Jan 31, 2024
jdx added a commit that referenced this issue Jan 31, 2024
jdx added a commit that referenced this issue Jan 31, 2024
jdx added a commit that referenced this issue Jan 31, 2024
@jdx jdx closed this as completed in #1564 Jan 31, 2024
jdx added a commit that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant