Skip to content

refactor(desktop): split pty_host.go out of paste_image.go - #320

Merged
attson merged 1 commit into
mainfrom
refactor/extract-pty-host
Aug 4, 2026
Merged

refactor(desktop): split pty_host.go out of paste_image.go#320
attson merged 1 commit into
mainfrom
refactor/extract-pty-host

Conversation

@attson

@attson attson commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

`desktopPtyHost` is the desktop-side adapter that satisfies the relay's `ptyhost.PtyHost` / `ImagePasteHost` / `FilePasteHost` interfaces. It lived inside `paste_image.go` by accident of who first needed it — but the struct itself, its `Write` override, and its PTY-input debug logging are shared with `paste_file.go` and are not image-paste concerns.

Move the struct + `Write` + `ptyInputDebugTag` + `logPtyInput` into a new `desktop/pty_host.go`. `PasteImage` stays in `paste_image.go` alongside its `savePastedImage` / native-clipboard implementations — same split as `paste_file.go` already has for `PasteFile`.

Net: same code, split by responsibility.

Test plan

  • `go test ./desktop/...` green (21s)
  • `go vet ./desktop/...` clean

`desktopPtyHost` is the desktop-side adapter that satisfies the relay's
ptyhost.PtyHost / ImagePasteHost / FilePasteHost interfaces. It lived
inside paste_image.go by accident of who first needed it — but the
struct itself, its Write override, and its PTY-input debug logging
are shared with paste_file.go and are not image-paste concerns.

Move the struct + Write + ptyInputDebugTag + logPtyInput into a new
desktop/pty_host.go. PasteImage stays in paste_image.go alongside its
savePastedImage / native clipboard implementations — same split as
paste_file.go already has for PasteFile.

Net: same code, split by responsibility. `go test ./desktop/...` green.
@attson
attson merged commit ad51464 into main Aug 4, 2026
7 checks passed
@attson
attson deleted the refactor/extract-pty-host branch August 4, 2026 11:45
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