tmux inside an AWS SSM session forces white cursor #23027

Closed
opened 2026-01-31 08:30:15 +00:00 by claunia · 8 comments
Owner

Originally created by @NicosGollan-cnic on GitHub (Mar 17, 2025).

Windows Terminal version

1.21.10351.0

Windows build number

10.0.26100.0

Other Software

gossm v1.5.0
tmux 3.0a
ubuntu 20.04, 22.04, 24.04

Steps to reproduce

  • Inside a WSL Linux session in Terminal (Ubuntu)
  • Connect to an AWS EC2 instance running Ubuntu 20.04
    Image
  • Start a tmux session
    Image

Expected Behavior

I expect the cursor colour to remain the same. Normally, I have a dark blue cursor on a light background.

Actual Behavior

The cursor is forced to pure white when starting or terminating the tmux session.

Opening Terminal settings and saving them without any changes restores the cursor to the intended colour, and it remains that way for the remainder of the tmux session.

This does not happen when running tmux "natively" in the "parent" WSL terminal, so far I only encountered the behaviour when running tmux in an SSM session.

Originally created by @NicosGollan-cnic on GitHub (Mar 17, 2025). ### Windows Terminal version 1.21.10351.0 ### Windows build number 10.0.26100.0 ### Other Software gossm v1.5.0 tmux 3.0a ubuntu 20.04, 22.04, 24.04 ### Steps to reproduce * Inside a WSL Linux session in Terminal (Ubuntu) * Connect to an AWS EC2 instance running Ubuntu 20.04 ![Image](https://github.com/user-attachments/assets/4b291944-9e74-4fc2-9450-d5a0c005bc40) * Start a tmux session ![Image](https://github.com/user-attachments/assets/5d2e1be8-2999-4bc5-9d3b-91feefbb7fc0) ### Expected Behavior I expect the cursor colour to remain the same. Normally, I have a dark blue cursor on a light background. ### Actual Behavior The cursor is forced to pure white when starting or terminating the tmux session. Opening Terminal settings and saving them without any changes restores the cursor to the intended colour, and it remains that way for the remainder of the tmux session. This does not happen when running tmux "natively" in the "parent" WSL terminal, so far I only encountered the behaviour when running tmux in an SSM session.
claunia added the Resolution-By-DesignIssue-BugResolution-Duplicate labels 2026-01-31 08:30:16 +00:00
Author
Owner

@lhecker commented on GitHub (Mar 19, 2025):

Thanks! Would you mind grabbing us the output of the debug tab? https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap

In particular, look out for OSC 12: ␛]12.

@lhecker commented on GitHub (Mar 19, 2025): Thanks! Would you mind grabbing us the output of the debug tab? https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap In particular, look out for OSC 12: `␛]12`.
Author
Owner

@NicosGollan-cnic commented on GitHub (Mar 20, 2025):

Hey, thanks for the response, below is what happens when I start tmux in a gossm-initiated session, starting with the prompt where I enter "tmux". I hope that's enough since I don't exactly feel like redacting various IDs from a tonne of raw ANSI terminal :-)

In particular, after sending the prompt, there appears to be this sequence before it runs off to the tmux status line, starting with the "$ " of the prompt: $␣␛[O␛[?12l␛[?25l␛[30m␛[42m

␛[13;28;13;0;32;1_␛[32m␛[1mapp@cron␛[m:␛[34m␛[1m/var/snap/amazon-ssm-agent/9881␛[m$␣␛]0;app@cron:␣/var/snap/amazon-ssm-agent/9881␇␛[84;20;116;1;32;1_t␛[84;20;116;0;32;1_␛[77;50;109;1;32;1_m␛[77;50;109;0;32;1_␛[85;22;117;1;32;1_u␛[85;22;117;0;32;1_␛[88;45;120;1;32;1_x␛[88;45;120;0;32;1_␛[32;57;32;1;32;1_␣␛[32;57;32;0;32;1_␛[13;28;13;1;32;1_␍␊
␛[?1049h␛[22;0;0t␛[?1h␛=␛[2J␛[?12l␛[?1000l␛[?1002l␛[?1006l␛[?1005l␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛]112␇␛[?25l␛[H␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␛[H␛[?25h␛[13;28;13;0;32;1_␛[?12l␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛[?12l␛[?25l␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␛[30m␛[42m␍␊
[33]␣0:tmux*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣"cron.eu-central-1a.li"␣08:08␣20-Mar-25␛[H␛[?25h␛[mapp@cron:/var/snap/amazon-ssm-agent/9881$␣␛[O␛[?12l␛[?25l␛[30m␛[42m␛[68;1H[33]␣0:bash*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣"cron.eu-central-1a.li"␣08:08␣20-Mar-25␛[1;43H␛[?25h␛[I␛[?12l␛[?25l␛[m␛[30m␛[42m␛[68;1H[33]␣0:bash*␣␣␣␣���␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣"cron.eu-central-1a.li"␣08:09␣20-Mar-25␛[1;43H␛[?25h␛[O
@NicosGollan-cnic commented on GitHub (Mar 20, 2025): Hey, thanks for the response, below is what happens when I start tmux in a gossm-initiated session, starting with the prompt where I enter "tmux". I hope that's enough since I don't exactly feel like redacting various IDs from a tonne of raw ANSI terminal :-) In particular, after sending the prompt, there appears to be this sequence before it runs off to the tmux status line, starting with the "$ " of the prompt: `$␣␛[O␛[?12l␛[?25l␛[30m␛[42m` ``` ␛[13;28;13;0;32;1_␛[32m␛[1mapp@cron␛[m:␛[34m␛[1m/var/snap/amazon-ssm-agent/9881␛[m$␣␛]0;app@cron:␣/var/snap/amazon-ssm-agent/9881␇␛[84;20;116;1;32;1_t␛[84;20;116;0;32;1_␛[77;50;109;1;32;1_m␛[77;50;109;0;32;1_␛[85;22;117;1;32;1_u␛[85;22;117;0;32;1_␛[88;45;120;1;32;1_x␛[88;45;120;0;32;1_␛[32;57;32;1;32;1_␣␛[32;57;32;0;32;1_␛[13;28;13;1;32;1_␍␊ ␛[?1049h␛[22;0;0t␛[?1h␛=␛[2J␛[?12l␛[?1000l␛[?1002l␛[?1006l␛[?1005l␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛]112␇␛[?25l␛[H␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␛[H␛[?25h␛[13;28;13;0;32;1_␛[?12l␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛[?12l␛[?25l␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␛[30m␛[42m␍␊ [33]␣0:tmux*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣"cron.eu-central-1a.li"␣08:08␣20-Mar-25␛[H␛[?25h␛[mapp@cron:/var/snap/amazon-ssm-agent/9881$␣␛[O␛[?12l␛[?25l␛[30m␛[42m␛[68;1H[33]␣0:bash*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣"cron.eu-central-1a.li"␣08:08␣20-Mar-25␛[1;43H␛[?25h␛[I␛[?12l␛[?25l␛[m␛[30m␛[42m␛[68;1H[33]␣0:bash*␣␣␣␣���␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣"cron.eu-central-1a.li"␣08:09␣20-Mar-25␛[1;43H␛[?25h␛[O ```
Author
Owner

@DHowett commented on GitHub (Mar 26, 2025):

Hey, funny enough... this is something we expressly added support for!

I see ␛]112␇ in your trace output.

According to the big document of control sequences, this is the code for "Reset Cursor Color". Something in your remote config is requesting that we reset the cursor color.

@DHowett commented on GitHub (Mar 26, 2025): Hey, funny enough... this is something we expressly added support for! I see `␛]112␇` in your trace output. According to [the big document of control sequences](https://www.invisible-island.net/xterm/ctlseqs/ctlseqs.html), this is the code for "Reset Cursor Color". Something in your remote config is requesting that we reset the cursor color.
Author
Owner

@DHowett commented on GitHub (Mar 26, 2025):

FWIW,

Image

@DHowett commented on GitHub (Mar 26, 2025): FWIW, ![Image](https://github.com/user-attachments/assets/af05da29-4797-4b23-8cb3-4ef04f54085e)
Author
Owner

@NicosGollan-cnic commented on GitHub (Mar 27, 2025):

What does it "reset to" though? By default, I have that dark blue colour everywhere, and saving settings even restores it, so my expectation would be that any "reset" would restore it to that dark colour instead of white.

@NicosGollan-cnic commented on GitHub (Mar 27, 2025): What does it "reset to" though? By default, I have that dark blue colour everywhere, and saving settings even restores it, so my expectation would be that any "reset" would restore it to that dark colour instead of white.
Author
Owner

@DHowett commented on GitHub (Mar 27, 2025):

You know what? You're right. It's resetting to a built-in default because we don't actually fully support the reset OSC.

We're tracking that over in /dup #3719, and I just started work on it (you caught me on a bored Thursday with some extra time...)

@DHowett commented on GitHub (Mar 27, 2025): You know what? You're right. It's resetting to a built-in default because we don't actually fully support the reset OSC. We're tracking that over in /dup #3719, and I just started work on it (you caught me on a bored Thursday with some extra time...)
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Mar 27, 2025):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Mar 27, 2025): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Author
Owner

@DHowett commented on GitHub (Mar 27, 2025):

For what it's worth, it looks like the Windows Console has always implemented it this way! Back in the original commit in this repository, it seems like we implemented the reset cursor color OSC by way of "set it to all white" (actually, INVALID_COLOR -- which triggers it to reset to invert rather than white).

This may not have always applied to Terminal because the console host was filtering it out. Now that there is no filtering, Terminal is exposed to a lot more...

@DHowett commented on GitHub (Mar 27, 2025): For what it's worth, it looks like the Windows Console has always implemented it this way! Back in the original commit in this repository, it seems like we implemented the reset cursor color OSC by way of "set it to all white" (actually, `INVALID_COLOR` -- which triggers it to reset to _invert_ rather than _white_). This may not have always applied to Terminal because the console host was filtering it out. Now that there is no filtering, Terminal is exposed to a lot more...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23027