$ dotnet fsi
Microsoft (R) F# Interactive version 13.9.201.0 for F# 9.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> fsi;;
val it: FSharp.Compiler.Interactive.InteractiveSession =
FSharp.Compiler.Interactive.InteractiveSession
{CommandLineArgs = [|"/usr/local/share/dotnet/sdk/9.0.200/FSharp/fsi.dll"|];
EventLoop = FSharp.Compiler.Interactive.SimpleEventLoop;
FloatingPointFormat = "g10";
FormatProvider = ;
PrintDepth = 100;
PrintLength = 100;
PrintSize = 10000;
PrintWidth = 78;
ShowDeclarationValues = true;
ShowIEnumerable = true;
ShowProperties = true;}
Re-implementing the whole InteractiveSession for the "packed" setup probably isn't necessary, maybe we can just inject a reduced version that only includes .CommandLineArgs?
I prefer using that over System.Environment.GetCommandLineArgs() because the latter starts with the path to fsi.dll when running under the actual dotnet fsi, and we’d have to trim it manually.
Moreover, if the code is packed as a self-contained executable, trimming is unnecessary/wrong. It'd be great if the injected fsi.CommandLineArgs could free us from the manual if-else.
Re-implementing the whole InteractiveSession for the "packed" setup probably isn't necessary, maybe we can just inject a reduced version that only includes
.CommandLineArgs?I prefer using that over
System.Environment.GetCommandLineArgs()because the latter starts with the path tofsi.dllwhen running under the actualdotnet fsi, and we’d have to trim it manually.Moreover, if the code is packed as a self-contained executable, trimming is unnecessary/wrong. It'd be great if the injected
fsi.CommandLineArgscould free us from the manualif-else.