Skip to content

Improve Terminal Reliability + Copilot Image Attachments - #338

Merged
hendrikmennen merged 4 commits into
mainfrom
fix/terminal-resilience
Aug 6, 2026
Merged

Improve Terminal Reliability + Copilot Image Attachments#338
hendrikmennen merged 4 commits into
mainfrom
fix/terminal-resilience

Conversation

@hendrikmennen

@hendrikmennen hendrikmennen commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Overview

Improves terminal reliability and shell integration, and adds image attachment support to Copilot chat.

Terminal reliability

Output no longer lost in background tabsReplayBufferedConnection wraps the pty connection and buffers output produced while no control is subscribed (i.e. while a tab is not selected), replaying it once the tab is shown again. Previously every byte written by a shell in an unselected tab was dropped, leaving holes in the output — or nothing at all for commands the AI ran in a background tab. The buffer is capped at 1 MB and only fills when there is no subscriber, so data is never delivered twice. Covered by ReplayBufferedConnectionTests.

Shell integration — the shell now emits invisible OSC 633 sequences at prompt boundaries so OneWare can detect when a command starts and what exit code it finished with. Hooks are installed via startup files (bash --init-file, zsh ZDOTDIR, PowerShell -Command) so nothing is ever echoed into the user-facing terminal. Scripts live under ~/.oneware/shell-integration rather than the shared temp directory to avoid a TOCTOU swap by another user.

PowerShell is now launched with -ExecutionPolicy Bypass, matching VS Code. Without it, systems with the default Restricted/AllSigned policy failed to dot-source the integration script and greeted the user with a PSSecurityException on every terminal start.

Copilot image attachments

Ctrl+V in the chat input now attaches an image from the clipboard instead of doing nothing useful:

  • IChatService.TryAddImageAttachment is a new opt-in member with a default false return, so existing chat services stay source- and binary-compatible.
  • CopilotChatService implements it by mapping the bytes onto the SDK's AttachmentBlob (base64 Data + MimeType).
  • The attachment chip shows a small decoded thumbnail for images; file/selection chips keep the existing icon.
  • If the clipboard holds no image — or the active service doesn't support images — the handler falls back to a normal text paste, so Ctrl+V behaviour is unchanged elsewhere.

Thumbnails are disposed when a chip is removed and after send.

Installer

Fixes a signing issue in the Windows installer build.

Testing

  • dotnet build clean on the touched projects (0 errors).
  • New unit tests for ReplayBufferedConnection covering buffering, replay, and the byte cap.
  • Manually verified the PowerShell terminal starts without a PSSecurityException under a restricted execution policy.

@hendrikmennen hendrikmennen changed the title . Improve Terminal Reliability Aug 6, 2026
@hendrikmennen hendrikmennen changed the title Improve Terminal Reliability Improve Terminal Reliability + Copilot Image Attachments Aug 6, 2026
@hendrikmennen
hendrikmennen merged commit 90bf9d9 into main Aug 6, 2026
5 checks passed
@hendrikmennen
hendrikmennen deleted the fix/terminal-resilience branch August 6, 2026 15:14
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