Skip to content

display-message -p (writing to stdout) doesn't work when called from within another command #2512

@cipriancraciun

Description

@cipriancraciun

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions