fix: cli stuff on windwos #2697
Draft
janburzinski wants to merge 12 commits into
Draft
Conversation
Collaborator
Author
Contributor
Greptile SummaryThis PR updates Windows PTY behavior for local and remote terminal sessions. The main changes are:
Confidence Score: 4/5These fixes should be updated before merging.
apps/emdash-desktop/src/renderer/features/tasks/conversations/conversation-manager.ts; apps/emdash-desktop/src/main/core/pty/local-pty.ts
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/src/main/core/pty/local-pty.ts | Adds queued Windows mouse injection, but failed injection can still leave local mouse reports undelivered. |
| apps/emdash-desktop/src/main/core/pty/windows-console-input.ts | Adds the PowerShell helper used to write SGR mouse text into the Windows console input queue. |
| apps/emdash-desktop/src/renderer/features/tasks/conversations/conversation-manager.ts | Adds conversation remote detection, but it can snapshot SSH sessions as local before mount state is ready. |
| apps/emdash-desktop/src/renderer/features/tasks/terminals/terminal-manager.ts | Updates terminal sessions to evaluate SSH state lazily when selecting the Windows PTY backend. |
| apps/emdash-desktop/src/renderer/features/tasks/stores/lifecycle-scripts.ts | Passes provisioned SSH state into lifecycle script PTY sessions. |
| apps/emdash-desktop/src/renderer/lib/pty/pty-session.ts | Adds lazy remote-state support before selecting the local Windows ConPTY backend. |
| apps/emdash-desktop/src/renderer/lib/pty/pty.ts | Adds local ConPTY backend configuration and synthetic mouse mode mirroring for xterm. |
| apps/emdash-desktop/src/renderer/lib/pty/use-pty.ts | Routes xterm binary input through the PTY RPC layer. |
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
apps/emdash-desktop/src/renderer/features/tasks/conversations/conversation-manager.ts:281
**Conversation backend snapshots** This still captures `isRemote` as a boolean when the conversation PTY session is created. Conversation stores can be acquired before the SSH project is mounted, so `getProjectSshConnectionId()` returns `undefined`; later provisioning reuses the existing conversation store without updating that session. On Windows, that remote conversation can still connect as a local ConPTY session and enable local-only mouse handling for an SSH PTY.
### Issue 2 of 2
apps/emdash-desktop/src/main/core/pty/local-pty.ts:96
**Fallback still drops mouse** When the PowerShell injector times out, fails to spawn, or cannot attach, this path writes the original SGR mouse bytes to the Windows PTY. For local ConPTY sessions those bytes are not the console input events the app is trying to inject, so clicks or wheel reports can still disappear whenever helper injection fails. The fallback needs to treat failed injection as undelivered input instead of assuming raw PTY passthrough delivers the mouse event.
Reviews (2): Last reviewed commit: "fix(pty): preserve lifecycle script ssh ..." | Re-trigger Greptile
Collaborator
Author
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.
Description
Checklist
messages and, when possible, the PR title