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:
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 cp
or ls
. This is on Linux using Zsh. The issue does not occur when using Bash and in .tmux.conf
, neither default-command
nor 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 tmux
:
➜ 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 tmux
:
➜ 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.
Running /bin/rm test
— using the full binary path — has the same result as above.
Also, rm --help
also replaces rm
with tmux
:
➜ 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
rm
a regular binary executable? or a wrapper script? or a function? Or a builtin in your particular shell? What shell are you using?rm
is aliased torm -i
andwhere rm
returns/bin/rm
. I'm using zsh.rm: cannot remove 'test': Is a directory
)rm
is from GNU coreutils or not, but the man page forrm
is at least from GNU coreutils 8.23