Improve Terminal Reliability + Copilot Image Attachments - #338
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Improves terminal reliability and shell integration, and adds image attachment support to Copilot chat.
Terminal reliability
Output no longer lost in background tabs —
ReplayBufferedConnectionwraps 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 byReplayBufferedConnectionTests.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, zshZDOTDIR, PowerShell-Command) so nothing is ever echoed into the user-facing terminal. Scripts live under~/.oneware/shell-integrationrather 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 defaultRestricted/AllSignedpolicy failed to dot-source the integration script and greeted the user with aPSSecurityExceptionon every terminal start.Copilot image attachments
Ctrl+Vin the chat input now attaches an image from the clipboard instead of doing nothing useful:IChatService.TryAddImageAttachmentis a new opt-in member with a defaultfalsereturn, so existing chat services stay source- and binary-compatible.CopilotChatServiceimplements it by mapping the bytes onto the SDK'sAttachmentBlob(base64Data+MimeType).Ctrl+Vbehaviour 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 buildclean on the touched projects (0 errors).ReplayBufferedConnectioncovering buffering, replay, and the byte cap.PSSecurityExceptionunder a restricted execution policy.