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.
test is a directory, then this happens:
jameswright in ~ at portal1 via ⬢ v12.13.0 ➜ rm test tmux: cannot remove ‘test’: Is a directory
Note this behavior doesn't occur when using
ls. This is on Linux using Zsh. The issue does not occur when using Bash and in
default-shell are set.
However, if I prefix the command with
env -i — as in
env -i rm test — I am properly seeing
rm as the command and not
➜ env -i rm test rm: cannot remove 'test': Is a directory
Also, if I use
strace to try and debug the problem -- using
strace -fostrace.out rm test-- I am also correctly seeing
rm instead of
➜ strace -fostrace2.out rm test rm: cannot remove 'test': Is a directory
Any ideas as to how this could happen?
I assume the error message should be generated by the offending command, but this appears to say otherwise.
/bin/rm test — using the full binary path — has the same result as above.
rm --help also replaces
➜ rm --help Usage: tmux [OPTION]... FILE... Remove (unlink) the FILE(s). -f, --force ignore nonexistent files and arguments, never prompt .... .... To remove a file whose name starts with a '-', for example '-foo', use one of these commands: tmux -- -foo tmux ./-foo
rma regular binary executable? or a wrapper script? or a function? Or a builtin in your particular shell? What shell are you using?
rmis aliased to
/bin/rm. I'm using zsh.
rm: cannot remove 'test': Is a directory)
rmis from GNU coreutils or not, but the man page for
rmis at least from GNU coreutils 8.23