Handle systemd OSC 3008 spec, otherwise gibberish in the terminal
systemd version 258 introduces OSC 3008 spec recently.
https://github.com/systemd/systemd/blob/main/docs/OSC_CONTEXT.md
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.
I’ve found a temporary workaround for this issue.
You can open the file /etc/profile.d/80-systemd-osc-context.sh and add a line return at the very top of the file, then save it. After reopening your terminal session, the problem should be resolved.
However, please note that this change might be reverted after running apt update && apt full-upgrade, as the file may get overwritten and the return line removed.
In the long run, since OSC 3008 seems to be the direction things are heading, I also hope that WindTerm will add support for OSC 3008 in future releases.