diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-20 00:21:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-20 00:21:32 +0200 |
| commit | 9d29441a84858780f80ff1bc35ce9c0c5f43b0c9 (patch) | |
| tree | a8754c76363bec0b5f5421416067f9a8421d027b /scripts/test_windows_input.ps1 | |
| parent | 856b64b9bfd41b9d3d82e2375ed5b4bf941fda28 (diff) | |
test(windows): distinguish clipboard paste origin in input gauntlet (#4394)
* test(windows): distinguish clipboard paste origin in input gauntlet
refs #4314
* test(windows): correct gauntlet paste-origin evidence
refs #4314
Diffstat (limited to 'scripts/test_windows_input.ps1')
| -rw-r--r-- | scripts/test_windows_input.ps1 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/test_windows_input.ps1 b/scripts/test_windows_input.ps1 index 7396bffa..364ce414 100644 --- a/scripts/test_windows_input.ps1 +++ b/scripts/test_windows_input.ps1 @@ -111,6 +111,18 @@ function Outer-State($Plan) { $Plan.outer_sequence = $state.sequence return $state } +function Get-GauntletClientTrace($Plan) { + # The client writes its mapper trace into the named session's data directory. + # The client log grows independently of the transport log, so this keeps its + # own cursor rather than reusing the transport line count. + $log = Join-Path $Plan.config_home "herdr/sessions/$($Plan.session)/herdr-client.log" + if (-not (Test-Path -LiteralPath $log)) { return $null } + $lines = @(Get-Content -LiteralPath $log | Where-Object { $_ -like '*windows input trace: input batch*' }) + $since = if ($Plan.ContainsKey('client_trace_lines')) { [int]$Plan.client_trace_lines } else { 0 } + $Plan.client_trace_lines = $lines.Count + if ($lines.Count -le $since) { return @() } + return @($lines | Select-Object -Skip $since) +} function Set-ObservedGeometry($Plan, $Window, $WindowPid, $Width, $Height) { # Correct against actual console cell measurements, not a claimed pixel size. for ($attempt = 0; $attempt -lt 8; $attempt++) { @@ -351,6 +363,12 @@ try { $row.input_reader = if ($trace.Contains('reader=windows-console')) { 'windows-console' } elseif ($trace.Contains('reader=crossterm')) { 'crossterm' } else { 'unknown' } if ($captureTrace.Contains('transport=win32-serialized')) { $row.input_transport = 'win32-serialized' } } + if ($path -in @('herdr', 'herdr-remote')) { + # The mapper's own client-event view disambiguates a paste the + # terminal issued from a remote-image-bridge reaction (#4314). + $clientEvents = Get-GauntletClientTrace $plan + if ($null -ne $clientEvents) { $row.client_events = $clientEvents } + } if ($null -ne $clipboardSequence) { if (-not [HerdrInputGauntlet.Desktop]::ClearOwnedClipboard($window, $clipboardSequence)) { throw 'Could not clear test-owned clipboard' } $clipboardSequence = $null |
