Presently, Midnight Commander initialises interactive instances of bash in such a way that it fails to acknowledge that it is possible for PROMPT_COMMAND to be an array, as is supported since bash 5.1. This is material to Gentoo because >=bash-5.1_p16-r8 and >=bash-5.2-p26-r1 do initialise the variable as an array. Besides which, anyone might do the same in their own ~/.bashrc file. I shall attach a patch that I think is suitable for Gentoo, whose commit message will contain a detailed rationale.
Created attachment 891294 [details, diff] mc-4.8.31-clear-PROMPT_COMMAND.patch
To comment further, upstream ought to be doing something like this: if eval '[[ ${PROMPT_COMMAND@a} == *a* ]]' 2>/dev/null; then PROMPT_COMMAND+=('mc crap goes here') else PROMPT_COMMAND+=';mc crap goes here' fi I maintain that the attached patch is likely the better solution for Gentoo, however.
There are times at which I wish I could edit comments. Rather, upstream could fix it from their perspective by doing something like: if eval '[[ ${PROMPT_COMMAND@a} == *a* ]]' 2>/dev/null; then PROMPT_COMMAND+=('mc crap goes here') else PROMPT_COMMAND+=${PROMPT_COMMAND+$PROMPT_COMMAND$'\n'}'mc crap goes here' fi