fix(data): normalize a list working dir's trailing separator on write
A list working_dir stored as "C:\Dev\Tests\StaplerTracking\" broke every consumer that puts it on a Windows command line: argv rules read \" as an escaped quote, so the token never closes. "Open in terminal" passed wt.exe a starting directory of C:\Dev\Tests\StaplerTracking" and it failed with 0x8007010b; the same data had already corrupted the ConPTY list handler's arg list in August. Paths.TrimTrailingSeparator is now the single helper (replacing the copies in InteractiveLaunchSpecService and ClaudeHelpLauncher) and ListRepository applies it on Add/Update, which covers every writer: UI create, repo import, hub UpdateList, and MCP CreateList/UpdateList. OpenInTerminal also switches to ArgumentList so its quoting is correct regardless of what's stored.
This commit is contained in:
@@ -143,15 +143,21 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
var dir = row?.WorkingDir;
|
||||
if (string.IsNullOrWhiteSpace(dir) || !System.IO.Directory.Exists(dir)) return;
|
||||
// Trailing separator + ArgumentList, not string interpolation: "C:\repo\" would parse as
|
||||
// C:\repo" and wt would refuse it as a starting directory (Paths.TrimTrailingSeparator).
|
||||
// Rows loaded before ListRepository normalized on write can still carry one.
|
||||
dir = Paths.TrimTrailingSeparator(dir)!;
|
||||
ForegroundHelper.AllowAny();
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||
var psi = new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = "wt.exe",
|
||||
Arguments = $"-d \"{dir}\"",
|
||||
UseShellExecute = true,
|
||||
});
|
||||
};
|
||||
psi.ArgumentList.Add("-d");
|
||||
psi.ArgumentList.Add(dir);
|
||||
System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user