kingToolbox / kingToolbox/WindTerm

Handle systemd OSC 3008 spec, otherwise gibberish in the terminal

Open
#3,075 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
32.3k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

systemd version 258 introduces OSC 3008 spec recently.

[https://github.com/systemd/systemd/blob/main/docs/OSC_CONTEXT.md](https://github.com/systemd/systemd/blob/main/docs/OSC_CONTEXT.md)

[https://systemd.io/OSC_CONTEXT/](https://systemd.io/OSC_CONTEXT/)

These escape codes are handled nicely by most terminals and, IMHO, should be kept that way.
Unfortunately, WindTerm fails to handle OSC escape codes in general, leading to gibberish littered all over the prompt.

#### Quick workaround:
If you are using systemd 258 and observed littering behavior:
**Method 1.** Remove the file /etc/profile.d/80-systemd-osc-context.sh
**Method 2.** `unset` the variable `PS0` and `PROMPT_COMMAND`

#### Long-term fix required:
Handle these OSC escape codes in WindTerm.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with systemd 258 and the OSC 3008 sequences emitted by /etc/profile.d/80-systemd-osc-context.sh, including the PS0 and PROMPT_COMMAND workaround. Trace how WindTerm processes terminal escape codes; done means OSC 3008 is handled without gibberish while normal prompt output remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, shell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.