Skip to content

Unable to passthrough DCS sequence #3755

Closed

Description

@gpanders

Issue description

The DCS passthrough (\ePtmux;...\e\\) does not allow passing through other DCS sequences, because the ST terminator from the "inner" DCS is consumed by tmux as the terminator of the outer passthrough sequence.

The use case is using XTGETTCAP in an application to query the outer/host terminal for terminal capabilities. For instance, to query for the Ms capability we use the DCS sequence \eP+q4D73\e\\. Wrapping this in the passthrough DCS gives you \ePtmux;\e\eP+q4D73\e\\\e\\. However, tmux sees the first \e\\ as the terminator for the passthrough sequence, so what ends up being forwarded to the terminal is \eP+q4D73, without the terminator.

Not all terminals require the terminator, but some do and will refuse to parse the DCS if the terminator is missing.

Steps to reproduce:

tmux -v
printf '\x1bPtmux;\e\eP+q4D73\e\\\e\\'

Required information

Please provide the following information:

  • tmux version (tmux -V): Tested both on 3.3a and on bdf8e614af34ba1eaa8243d3a818c8546cb21812

  • Platform (uname -sp): Darwin arm

  • $TERM inside and outside of tmux (echo $TERM): inside tmux is tmux-256color. This issue manifests in any terminal which requires an ST terminator for DCS sequences (kitty is the only one that I know of, xterm-kitty is $TERM)

  • Logs from tmux (tmux kill-server; tmux -vv new):

input_parse_buffer: %0 ground, 146 bytes: \033Ptmux;\033\033P+q4D73\033\\                                                   \r\342\217\216 \r\033[K
input_enter_dcs
input_dcs_dispatch: "tmux;\033P+q4D73"
/dev/ttys008: \033P+q4D73

Activity

  1. nicm commented on Nov 29, 2023

    @nicm
    Member

    You are missing a \e...

  2. gpanders commented on Nov 29, 2023

    @gpanders
    Author

    You are missing a \e...

    Thanks for the quick response. I was able to get it working. I did try this before opening the issue, but it hung my shell. But checking in the logs shows that tmux is forwarding the sequence correctly, so I'll hunt down what's going on there next.

  3. przepompownia commented on Nov 29, 2023

    @przepompownia

    Thanks from me too!

  4. github-actions commented on Dec 30, 2023

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  5. locked as resolved and limited conversation to collaborators on Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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