Skip to content

Filter unsupported OSC output from host-shell - #16

Merged
midwan merged 4 commits into
masterfrom
fix/host-shell-osc-filter
Jul 22, 2026
Merged

Filter unsupported OSC output from host-shell#16
midwan merged 4 commits into
masterfrom
fix/host-shell-osc-filter

Conversation

@midwan

@midwan midwan commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a stateful host-terminal output filter for host-shell.
  • Preserve ANSI CSI-to-Amiga CSI translation while removing unsupported OSC sequences.
  • Cover OSC, CSI, incomplete, and unknown escape sequences at every possible read split point.

Root cause

Modern Linux login shells can emit OSC metadata such as systemd's OSC 3008 command markers. host-shell translated ANSI CSI sequences but forwarded OSC bytes unchanged. Because the Amiga console does not understand OSC, it displayed the metadata payload as ordinary text.

Escape sequences can cross HostShell_Read() boundaries, so filtering each buffer independently would still leak partial metadata.

User impact

Interactive host shells no longer display systemd command metadata, terminal titles, or similar OSC payloads. Normal text and supported CSI formatting continue to work, including when an escape sequence is split across reads.

Validation

  • make test
  • Full AmigaOS 3 cross-build with sacredbanana/amiga-compiler:m68k-amigaos
  • Warning-free host-shell cross-build with the same image
  • git diff --check

Related

Modern Linux login shells emit terminal metadata such as systemd OSC
3008 markers. Track escape state across reads and remove OSC sequences
before writing output to the Amiga console.
@midwan
midwan marked this pull request as ready for review July 21, 2026 18:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 545ac922d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/host_terminal_filter.h Outdated
Bytes 0x9C and 0x9D can be UTF-8 continuation bytes. Recognize only
the 7-bit OSC forms emitted by the PTY so multibyte output remains
intact.
@midwan

midwan commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00eea6ec9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/host_terminal_filter.h
Track UTF-8 continuation bytes inside discarded OSC payloads. A
standalone 0x9C ends OSC while encoded 0x9C bytes remain payload.
@midwan

midwan commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd1af9213b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/host_terminal_filter.h Outdated
Track UTF-8 continuation bytes in text state so standalone 0x9D
starts OSC without dropping valid UTF-8 output.
@midwan

midwan commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 5c8994c5e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@midwan
midwan merged commit 26b93b2 into master Jul 22, 2026
2 checks passed
@midwan
midwan deleted the fix/host-shell-osc-filter branch July 22, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant