fix(ui): report failed paste/drop in the interactive terminal

PasteAsync silently swallowed every exception and returned void, so a
package update renaming Iciclecreek's private write seam would break
Ctrl+V/drop with zero user-visible signal. PasteAsync/SendTextAsync now
return bool (mirroring SendLineAsync), and the view checks the result,
routing a failure through InteractiveTerminalViewModel.ErrorReported ->
ConPtyPaneViewModel.ErrorReported -> the existing footer error strip.
This commit is contained in:
mika kuns
2026-09-10 13:35:16 +02:00
parent acff815706
commit 0cec0a77ee
9 changed files with 112 additions and 9 deletions
@@ -219,6 +219,35 @@ public class ConPtyPaneViewModelTests
Assert.True(raised);
}
// ── Terminal.ErrorReported forwarding (fix: a failed paste/drop had no path to the footer
// error strip) ────────────────────────────────────────────────────────────────────────────
[Fact]
public void TerminalErrorReported_Forwards_ToPaneErrorReported()
{
using var pane = NewTaskPane(NeverCompletes);
string? error = null;
pane.ErrorReported += msg => error = msg;
pane.Terminal.ReportSendFailed();
Assert.NotNull(error);
}
[Fact]
public void TerminalErrorReported_StillWiredAfterRetry()
{
using var pane = NewTaskPane(() => Failing());
pane.Start();
pane.RetryCommand.Execute(null);
string? error = null;
pane.ErrorReported += msg => error = msg;
pane.Terminal.ReportSendFailed();
Assert.NotNull(error);
}
private static void SetRunning(ConPtyPaneViewModel pane) => pane.Terminal.IsRunning = true;
// Drives the terminal past its startup grace window, then kills it: IsRunning stamps the launch