“ tmux”替换错误消息中的命令

When I'm inside a running tmux installation and run a command that errors out, sometimes tmux will replace the name of the original command.

ie. if test is a directory, then this happens:

jrwrigh in ~ at portal1 via ⬢ v12.13.0           
➜ rm test                                     
tmux: cannot remove ‘test’: Is a directory  

Note this behavior doesn't occur when using cp or ls. Any ideas as to how this could happen? I would've assumed the error message would be generated by the offending command, but this appears to say otherwise.