feat(ui): Einfuegen und Datei-Drop im interaktiven Terminal

Ctrl+V wurde von TerminalControl als rohes Control-Byte an das Kind
weitergegeben und tat nichts; jetzt wird es im Tunnel abgefangen und geht
ueber TerminalView.PasteAsync, damit Bracketed Paste greift und ein
mehrzeiliger Paste nicht auf der ersten Zeile abschickt. Gedroppte Dateien
werden als Pfade in den Composer getippt, ohne Enter.
This commit is contained in:
mika kuns
2026-09-07 08:17:37 +02:00
parent 0db9fadee9
commit 23491d3b49
5 changed files with 122 additions and 1 deletions
@@ -0,0 +1,26 @@
using ClaudeDo.Ui.Views;
using Xunit;
namespace ClaudeDo.Ui.Tests.Views;
public class InteractiveTerminalDropPathsTests
{
[Fact]
public void Quotes_only_paths_with_spaces_and_ends_with_a_separator()
{
var text = InteractiveTerminalView.FormatDroppedPaths(
new[] { @"C:\repo\a.cs", @"C:\my repo\b.cs" });
Assert.Equal("C:\\repo\\a.cs \"C:\\my repo\\b.cs\" ", text);
}
[Fact]
public void Skips_items_without_a_local_path()
{
// IStorageItem.TryGetLocalPath() returns null for non-filesystem items (e.g. a virtual
// shell folder) — those must not turn into empty quotes in the composer.
Assert.Equal(@"C:\repo\a.cs ", InteractiveTerminalView.FormatDroppedPaths(new[] { null, @"C:\repo\a.cs", " " }));
Assert.Equal(string.Empty, InteractiveTerminalView.FormatDroppedPaths(new string?[] { null }));
Assert.Equal(string.Empty, InteractiveTerminalView.FormatDroppedPaths(null));
}
}