fix: Broken Bash terminal on newer Linux distros (systemd >258) #463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #439
Bash terminal no longer functioned in Terminus under newer Linux distros (Fedora 43+, Arch etc). These distros propagate a new "OSC Context" feature to the default profile, which generates OSC sequence Terminus fails to find the end of.
There's a bug in parsing OSC (Operating System Command) sequences sent to the terminal, which use
ESC \as a terminator (as specified in ECMA-48). Specifically, OSC 3008 is encoded as follows per OSC Context specification:Basically, sequence start is encoded as
ESC ](which Terminus recognizes) and terminator is encoded asESC \(which isn't supported), so Terminus just reads following bytes indefinitely.I believe it's because Terminus mostly focuses on emulating simpler VTxxx-compatible terminals, however, it now seems we need to support at list some parts of ECMA-48 to keep up with modern terminals.
Reproducing the issue
/etc/profile.d/80-systemd-osc-context.shfile, which injects OSC 3008 sequence to your terminal;]3008;in Sublime's internal Console when you running Terminus withdebug: true(set in Preferences > Package Settings > Terminus > Settings);See my comment in the original issue for more information.
Before this PR: Terminal output is corrupted, Bash terminal unusable under Terminus.
After this PR: Bash terminal works as expected again.