From 812a76bb41948e680f65b9eeb9bf56b772e0e48d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 3 Sep 2026 13:57:58 -0700 Subject: [PATCH] [Fix] `nvm unload`: drop the undefined `nvm_format_help_message_colors` `unset -f` was passed a name that has never been a function. It arrived with `set-colors` in 6848c16d and has never existed. That matters because shells disagree about what `unset -f` does with a name that is not a function. bash unsets the rest of the list and carries on; Linux dash and zsh appear to stop there, which silently left every one of the ten names after it defined: `nvm_echo_with_colors`, `nvm_err_with_colors`, `nvm_get_artifact_compression`, `nvm_install_binary_extract`, `nvm_extract_tarball`, `nvm_process_nvmrc`, `nvm_process_nvmrc_content`, `nvm_nvmrc_invalid_msg`, `nvm_write_nvmrc`, and most recently `nvm_print_color_legend`. Nothing noticed until `nvm_print_color_legend` gained a test asserting that `nvm unload` removes it, because it sorts first among the survivors. With the dead name gone, every remaining entry is a real function, so no shell has an undefined name to disagree about. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index d130f00a..9e3f4d60 100755 --- a/nvm.sh +++ b/nvm.sh @@ -4956,7 +4956,7 @@ nvm() { nvm_node_version_has_solaris_binary nvm_iojs_version_has_solaris_binary \ nvm_curl_libz_support nvm_command_info nvm_is_zsh nvm_stdout_is_terminal \ nvm_npmrc_bad_news_bears nvm_sanitize_auth_header \ - nvm_get_colors nvm_set_colors nvm_print_color_code nvm_wrap_with_color_code nvm_format_help_message_colors \ + nvm_get_colors nvm_set_colors nvm_print_color_code nvm_wrap_with_color_code \ nvm_print_color_legend \ nvm_echo_with_colors nvm_err_with_colors \ nvm_get_artifact_compression nvm_install_binary_extract nvm_extract_tarball \