aboutsummaryrefslogtreecommitdiff
path: root/scripts/test_windows_input.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test_windows_input.ps1')
-rw-r--r--scripts/test_windows_input.ps118
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