Issue description
display-message -p some-format doesn't work when called as a consequence of another command, which is itself run from the terminal (i.e. tmux some-command 'display-message -p some-format').
The following works as expected (i.e. test is correctly piped to base64):
tmux display-message -p test | base64
The following doesn't work as expected, base64 receives nothing as input, and instead the display-message command is run just like run-shell "in the background" and it's output is displayed in copy-mode:
tmux choose-tree 'display-message -p %%' | base64
(I use here base64 to make sure that the output is actually given to tmux's stdout as opposed to writing it into the pane.)
This issue might be related to #2499, although that discusses command-prompt and stumbles into the same issue as this one. I don't think this is actually a duplicate, because perhaps a proper solution of that issue might be adding a similar -p flag to command-prompt.
Required information
Please provide the following information:
- tmux version (
tmux -V) -- tmux 3.1c
- Platform (
uname -sp) -- Linux 5.9.12-1-default x86_64
$TERM inside and outside of tmux (echo $TERM) -- rxvt-unicode (external) and screen (internal);
Issue description
display-message -p some-formatdoesn't work when called as a consequence of another command, which is itself run from the terminal (i.e.tmux some-command 'display-message -p some-format').The following works as expected (i.e.
testis correctly piped tobase64):The following doesn't work as expected,
base64receives nothing as input, and instead thedisplay-messagecommand is run just likerun-shell"in the background" and it's output is displayed in copy-mode:(I use here
base64to make sure that the output is actually given totmux's stdout as opposed to writing it into the pane.)This issue might be related to #2499, although that discusses
command-promptand stumbles into the same issue as this one. I don't think this is actually a duplicate, because perhaps a proper solution of that issue might be adding a similar-pflag tocommand-prompt.Required information
Please provide the following information:
tmux -V) --tmux 3.1cuname -sp) --Linux 5.9.12-1-default x86_64$TERMinside and outside of tmux (echo $TERM) --rxvt-unicode(external) andscreen(internal);