Arm a one-shot window/document capture listener on non-primary
pointerdown so releasing over the portalled context menu still
restores draggable, and share the helper across both surfaces.
Right-clicking a script package in the terminal scripts tree now shows
Rename and Delete. Vault package and snippet cards use asChild triggers
and ignore non-primary drags so Windows context menus are not swallowed.
Netcatty ships @cursor/sdk, so probing it from the Electron main process
always succeeded and Settings showed Cursor installed even with no
Cursor Agent CLI on the machine. Treat installed as CLI presence or
proven CLI login; keep sdkInstalled for API-key mode.
Strict bastion prompts (QAX/奇安信) treat one SSH channel write as a single keystroke and silently drop every multi-character chunk, so an IME commit of two or more hanzi and a Chinese paste both reach the bastion's search prompt as nothing at all. Single characters work, which is why typing them one at a time is the only path that works today.
Split plain multi-character text at the send boundary instead of adding a setting: the write side of handleTerminalInputData now iterates one chunk per Unicode code point, and all bookkeeping (command buffer, script recorder, autocomplete, sudo autofill, broadcast, scroll) still sees the original payload exactly once. IME commits split whenever the committed text has more than one code point; raw (non-bracketed) onData splits up to 32 characters and longer pastes keep the single write. Anything containing an escape sequence - bracketed paste wrappers, CSI-u composition, forwarded Kitty key sequences, cursor reports - is never split, and broadcast peers still receive the original string once.
Each chunk carries the same writeToSession options as the original single write, so the sensitive marker and automation flags are kept per character. Bridge writes stay one channel write per IPC call, which reproduces what Xshell sends on the same bastion (#3077).
Co-Authored-By: Claude <noreply@anthropic.com>
When the punctuation keyup was dropped and a previously held key was released
next, the recovery flushed the deferred key (recording a Kitty press) but then
released only the unrelated key, leaving the deferred press forwarded until
focus loss.
Replace the sentinel-rewrite predicate with resolveDeferredKeyupRelease, which
enumerates all three cases: sentinel releases take over the deferred key's
release identity, the deferred key's own release pairs the press directly, and
an unrelated release keeps its identity while the deferred press gets a
synthesized release.
Clearing a history object reused by a new session kept the previous
session's cell column, so a leading tab in the fresh output padded to the
wrong tab stop.
Co-Authored-By: Claude <noreply@anthropic.com>
Follow-ups on the alternate-screen preview transcript:
- Cap the pending escape tail on its introducer, so an oversized control
string split across chunks is not re-parsed as transcript text.
- Write spans in bounded pieces, committing a full line at the character cap,
instead of clipping a span and dropping its remainder.
- Track the cursor in terminal cells (not UTF-16 length) so tab stops land
correctly after wide glyphs.
- Apply erase-in-line (CSI 0K / 2K) to the open line, so a shorter progress
redraw leaves no stale suffix text behind.
Co-Authored-By: Claude <noreply@anthropic.com>
A modified keydown (Ctrl+C, Alt+...) is a command, not the continuation of the
lost punctuation keystroke. Leaving the deferral armed across it meant the next
ordinary keydown flushed the pending character in front of the user's input,
right after the interrupt or shortcut ran.
Discard the stale deferral when the next keydown carries Ctrl/Alt/Meta; an
active composition still resolves it via insertText.
Follow-ups on the alternate-screen preview transcript:
- C1 control-string introducers (DCS/SOS/OSC/PM/APC) were filtered as stray
control bytes, leaving their payload as transcript text; consume them
through the BEL / ESC-\ / C1 ST terminator like their ESC-based forms.
- Tabs were kept as-is, so a row's cell width under-counted against how the
preview pre element renders tab stops and long tabbed lines were clipped
instead of wrapping. Expand each tab to the next 8-column stop while
writing, and route tab padding through the same open-line budget as text
spans.
Co-Authored-By: Claude <noreply@anthropic.com>
The keydown recovery for a swallowed punctuation keyup flushes the deferred
key, which records a Kitty press locally and for broadcast peers. Since that
branch only runs when the release will never arrive, the press stayed
forwarded and the TUI saw the key held until focus loss or session reset.
Extract the forwarded-press release pairing into releaseForwardedKittyPress and
call it from the recovery with a release synthesized from the deferred physical
key, so the press/release pair completes in the same keystroke.
Two robustness gaps in the alternate-screen preview transcript:
- A cursor-addressed redraw (cursor-home CSI stripped, no LF) appended every
frame to the open line, which the character cap only checked on commit, so
it grew without limit and every append copied it whole. Commit the open
line once it reaches the budget and clip each span to the remaining room.
- Escape sequences were assumed to be two bytes, so intermediate bytes leaked
their final byte into the transcript (ESC ( B from ncurses/reset left a
stray B). Consume intermediates (0x20-0x2f) through the final byte
(0x30-0x7e) per ECMA-48.
Co-Authored-By: Claude <noreply@anthropic.com>
A real keyup for another held key could land while the punctuation deferral
was still armed (the deferred key's own release was swallowed). That release
was rewritten to the deferred physical key, so in Kitty report-event modes the
held key's forwarded press never got its release and the TUI saw it stuck down
until focus loss or session reset.
Restrict the rewrite to IME sentinel releases (Process/229/Unidentified/
Dead/Compose, mirroring the non-text DOM keys the Kitty encoder already
refuses to send as text). Any real release still ends the stale deferral, so
the #3103 recovery is unchanged.
Plain wheel in screen/vim/codex still forwards arrow keys (xterm's
alternate-scroll), and shift+wheel previewed xterm's normal buffer, which
holds no scrollback once an app owns the alternate buffer - so the preview
clamped to a single screen and looked dead (#2516).
When the alternate buffer is active and the normal buffer has no rows above
the viewport, the preview now renders the session's captured output instead:
a bounded plain-text transcript kept next to the connection log capture,
after the programmatic command rewriter (masked commands stay masked) and
before the replay sanitizer, which drops alternate-screen output on purpose.
Rows are wrapped to the terminal columns with wide-character awareness and
reuse the existing wrap-flag selection joining.
Mouse-reporting apps are untouched: their wheel events still go to the app.
Co-Authored-By: Claude <noreply@anthropic.com>
The CJK IME punctuation deferral (#2833) armed on a punctuation keydown and
only resolved on an insertText remap, an exact-key keyup, or a session reset.
Windows IMEs report Process/keyCode 229 as the keyup of a key they consumed,
or drop the keyup, so the deferred key stayed armed: the deferral then blocked
every keypress, and a second "/" search in vi (or any later keystroke routed
through keypress) never reached the PTY (#3103).
The deferral now ends on any real key release (composing releases excluded, so
an active composition still resolves via insertText) and a stale deferral is
flushed when the next unmodified, non-composing keydown for a different key
arrives. The keypress block is scoped to the deferred key instead of every
keypress, so a stale deferral can no longer swallow unrelated input. A mangled
release pairs its kitty release from the deferred physical key instead of the
Process/229 event.
Two changes based on Codex bot review feedback on PR #3156:
1. Preserve ZWNJ (U+200C) and ZWJ (U+200D) in terminal input.
These carry meaning in Persian orthography and emoji sequences;
PTYs can process the raw bytes, so stripping them could corrupt
filenames, args, and passwords that legitimately contain them.
2. Sanitize composition text before Kitty encoding.
When Kitty report-all + associated-text mode is negotiated,
encodeKittyCompositionText converts U+200B into an escape sequence
(e.g. ESC[0;;8203u) BEFORE reaching the handleTerminalInputData
guard. Sanitize the raw text in both composition paths
(commitImeTextInput remap path and onData handler) so zero-width
artifacts are stripped before encoding, not after.
Update pattern-matching tests to reflect the new variable names
(sanitizedText / sanitizedData) in the Kitty composition paths.