Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Tests/ToolLauncherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ public void ToStartInfo_preserves_no_shell_and_no_redirect()
Assert.False(start.RedirectStandardOutput);
Assert.False(start.RedirectStandardError);
Assert.Equal(["--flag"], start.ArgumentList.ToArray());
Assert.Equal("1", start.Environment["NDX_LAUNCHED"]);
}
}
5 changes: 4 additions & 1 deletion src/ndx/ProcessStartSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ namespace ndx;

/// <summary>
/// Process start settings for the downloaded tool. ndx always starts the child
/// without a shell and with inherited standard in/out/error.
/// without a shell, with inherited standard in/out/error, and with
/// <c>NDX_LAUNCHED=1</c> so the child can tell it was started by ndx.
/// </summary>
public sealed record ProcessStartSettings
{
Expand Down Expand Up @@ -33,6 +34,8 @@ public ProcessStartInfo ToStartInfo()
foreach (var argument in Arguments)
start.ArgumentList.Add(argument);

start.Environment["NDX_LAUNCHED"] = "1";

return start;
}
}
Expand Down
Loading