kingToolbox / kingToolbox/WindTerm
Raw OSC 3008 escape sequences are displayed when connecting to Ubuntu 26 via SSH
- Dominant language
- C
- Stars
- 32.3k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
# WinTerm displays raw OSC 3008 escape sequences when connecting to Ubuntu with systemd OSC Context enabled
## Environment
- WinTerm Version: 2.7.0
- OS: Windows
- Remote OS: Ubuntu 26.xx
- Shell: Bash 5.3.9
## Problem
When connecting to an Ubuntu 26 server via SSH, WinTerm displays raw OSC 3008 escape sequences directly in the terminal instead of interpreting or ignoring them.
The escape sequences appear before and after almost every command.
Example:
```text
]3008;start=8258a5b5-ec99-4177-bbe8-cf56e7e9b877;machineid=id;user=root;hostname=hostname;bootid=9db657a9-19f2-4e5e-818a-cbd2f30dc723;pid=00000000000000003197;type=command;cwd=/root\
```
After executing a normal command such as:
```bash
ls
```
The terminal displays:
```text
]3008;start=25a4cfac-374a-48d6-96da-acbe41c6372b;machineid=id;user=root;hostname=hostname;bootid=9db657a9-19f2-4e5e-818a-cbd2f30dc723;pid=00000000000000002246;type=command;cwd=/home/\
down.sh up.sh
```
## Investigation
The output originates from the following system script:
```text
/etc/profile.d/80-systemd-osc-context.sh
```
This script is included with newer versions of **systemd** and implements:
> **UAPI 15 – OSC 3008: Hierarchical Context Signalling**
Running:
```bash
grep -R "3008" /etc/profile.d
```
returns:
```text
/etc/profile.d/80-systemd-osc-context.sh
```
Disabling this script immediately eliminates the problem.
## Comparison
The same Ubuntu server works correctly with other SSH clients, including:
- Windows Terminal
- Xshell
- MobaXterm
- Tabby
Only WinTerm displays the OSC 3008 sequences as visible text.
## Expected Behavior
WinTerm should either:
- Support OSC 3008 (recommended), or
- Gracefully ignore unsupported OSC control sequences.
Unknown OSC sequences should never be rendered as plain text.
## Additional Information
The OSC 3008 messages contain metadata such as:
- machine-id
- hostname
- user
- cwd
- command start/end
- exit status
These are terminal control sequences intended for terminal integrations and should not be visible to users.
This appears to be a compatibility issue with the newer systemd OSC 3008 implementation rather than a server configuration issue.
Thank you!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce an SSH session against Ubuntu with /etc/profile.d/80-systemd-osc-context.sh enabled, then trace how WinTerm handles the emitted OSC 3008 sequences. Done means the metadata is interpreted or ignored rather than rendered as text, with regression coverage for commands such as ls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, c
- Domain
- cli, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100