dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.87k stars 781 forks source link

F# Interactive window does not support Console.Clear() etc. #5952

Open moloneymb opened 5 years ago

moloneymb commented 5 years ago

I would like to provide a simple console based progress bar for users running long running tasks in FSI. To do this I can clear the line and print the output. This works in normal FSI.exe console as well as in Ionide F# Interative Terminal but does not work in Visual Studio F# Interactive.

Repro steps

  1. Send "System.Console.Clear()" to FSI

Expected behavior

FSI window is cleared.

Actual behavior

A System.IO.IOException is thrown.

Known workarounds

Using Visual Studio Code instead of Visual Studio

Related information

voronoipotato commented 5 years ago

It's somewhat unclear to me what happens after the fsi window gets cleared. Do I get to add other commands after that? Where would they go?

moloneymb commented 5 years ago

You can try it now, in either Visual Studio Code or in the command line. It works fine. Just not in Visual Studio.

I'd like to override a single line by setting the cursor position and writing over the line.

xperiandri commented 3 years ago

I suppose it can be fixed as side effect of migrating to modern C#/Python like REPL tool window