Skip to content

Please support fsi.CommandLineArgs #24

@nodakai

Description

@nodakai
$ 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions