F# interactive do not accept more than 1357 characters. Neither by Fsi: Send File neither by Fsi: Send Selection
In the gif bellow, you can see that the text is sent to fsi when selection is 1357 chars and if I select one more char, nothing happens.

Looks like it's some problem with VSCode terminal integration. It may be good idea to create issue on VSCode repo.
I'm having the same problem, however I've noticed the limit is not always 1357. The number of lines seems to play a factor, as new lines seem to count for more than the two bytes I would expect.
I.e. lots of small lines will stop working before 1357 bytes, and long lines will continue working and fail somewhat beyond 1357.
Is there any kind of work around for this? Other than having very short scripts :-)
I guess @Tyriar could help us a bit with that... or at least tell us where to report issue ;)
I can select a > 6000 character string and send it via the regular command just fine. Maybe it only affects requests via the extension API?
Is the text processed at all before being sent to the terminal? If not I'd move the issue to Microsoft/vscode.
Hi Tyriar, the text doesn't seem to be processed or sent to the terminal (when over a certain length), as far as I can see.
I don't know if this is relevant, but I have the same issue on two machines, and on both I have Visual Studio 2015 installed. They're otherwise fairly different (e.g. Win 10 vs Win 7).
Between this and #340, the process for sending code to FSI might be a bit busted!
Thanks Red, I hope it gets some attention... I am always hopeful for new releases of Ionide or VSCode, but so far the problem persists.
We're teaching a class with F#, and the way we recommend users run their code is via "FSI: Send Selection". We were not aware of this issue or we'd have picked another approach.
I've just posted a USD $100 bounty here. In our case this is time-critical, but anybody who fixes this in the next six months will get the bounty.
Is this only happening on Windows? I have no issue sending text of lengths greater than 1400 via Terminal.sendText on Linux.
Can someone debug the extension and verify the strings are correct in these spots:
I can't reproduce it at all, sending > 5000 chars works without any problem.
Windows 10, VSCode Insiders.
I have this problem on a Windows 7 machine and a Windows 10 machine. One commonality that springs to mind is that both have Visual Studio 2015 Enterprise. Not sure if installed before or after VS Code.
I have this problem on Ubuntu 16.10
I can reproduce it on a windows 7 machine.
Please add VSCode and Ionide versions to error reports.
vscode: 1.8.1
ionide-fsharp: 2.20.0
Can't reproduce on 1.8.1, Ionide 2.20.0, Windows 10. :-(
VS Code 1.8.1
Ionide-FAKE 1.1.0
Ionide-fsharp 2.9.0
Ionide-Paket 1.3.2
Dalusia: can you update your ionide-fsharp package and see if this reproduces?
I can't reproduce here, but my setup is unconventional. Here is the test file I'm using.
1.9.0-insider (commit ee9d91c05fa571de56c41383cceee30b05b0a2f6 )14986.rs_prerelease.161202-1928)Sure thing Red. Have done & same problem. I can't get anywhere near your test file's length. I cut it down until it would execute, and could only manage 23 of the printfn statements (plus the first and last line).
Do you also have visual studio installed?
Ionide-fsharp at 2.23.0 now.
On win7, VSCode 1.8.1, ionide-fsharp 2.21.0 still occurs
On win10, VSCode 1.8.1 ionide-fsharp 2.21.0 cannot reproduce
Both have VS2015
@Dalusia I've updated my comment to reflect that yes, I have Visual Studio installed.
I don't believe it has anything to do with VS.
But looks like problem is occurring more on Windows 7.
It might also be happening in Ubuntu!
My working theory is that this is a platform agnostic, possibly
nondeterministic bug in VS Code. If this were the case, could it be worked
around somehow?
On Thu, Jan 26, 2017, 9:45 AM Krzysztof Cieślak, notifications@github.com
wrote:
I don't believe it has anything to do with VS.
But looks like problem is occurring more on Windows 7.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ionide/ionide-vscode-fsharp/issues/199#issuecomment-275405196,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABv_p75swxtg49JcOqfaA6aAAgmF0saYks5rWLGLgaJpZM4KUoep
.
On the VS Code end here's how it works:
If it is VS Code's issue maybe characters are being dropped over IPC or something?
If anyone who is reproducing could debug into these lines and check if the text is valid that should indicate whether it's a VS Code issue or not
If it is VS Code's issue maybe characters are being dropped over IPC or something?
To me it seems like the IPC step isn't reached, otherwise we would see partial input evaluated in FSI
If anyone who is reproducing could debug into these lines and check if the text is valid that should indicate whether it's a VS Code issue or not
I'm stuck trying to build ionide on a windows 7 so I could step through the code https://github.com/fable-compiler/Fable/issues/346#issuecomment-274931726
I don't know much about fable / vscode so I can't do much without some more guidance.
@smoothdeveloper oh this whole time I thought it was being truncated, it should be easier to find the cause then by debugging the extension and/or vscode.
Tested on a 16.04.1 Ubuntu install, while the output was glitchy (likely because of #340) I didn't reproduce this bug.
I'll prepare small VSCode plugin written in typescript to try to reproduce it in environment everyone can easily build.
@Krzysztof-Cieslak that would be great thanks
Here it is: https://github.com/Krzysztof-Cieslak/vscode-fsi-bug
Can you try reproducing bug following instructions in readme?

Well, at least we can confirm it's not Ionide ;)
Several students came in today to report FSI-related glitches. There was a theme: the code gets printed in the F# Interactive panel, but FSI does not output anything.
Nothing reproducible, or I would open another issue. But I'm getting the impression that the FSI component has quite a few gremlins hidden around!
Let's stay on topic here, and try to fix this one first.
@Tyriar, any ideas? @smoothdeveloper was able to reproduce it using plugin written in TypeScript so it seems it's not really issue on plugin / Ionide side.
@smoothdeveloper does it happen if you launch cmd/bash and send the same text?
Has anyone else noticed that copy+pasting to terminal or FSI console has the same character limit? This definitely excludes Ionide if you ask me.
I tested this function in isolation, because I can't get vscode to compile. The EOL thing doesn't seem to have any effect on the text.
Also I noticed that copy+paste probably goes through a separate function on this level.
Other than that one could try a workaround, where the string is split into 512 or 1024 character sequences and then sent chunked to the terminal. If this solves the issue, then we would know where it happens (at least somewhere below the layer where vscode is responsible for it).
Should we open an issue in the VS Code repo?
So I got around to testing my assumption. We can put in a workaround for the character limit in the plugin by chunking what we output to the terminal, but the problem is below the sendText function in Terminal. I tested my workaround with 80000 character with no issue.
Thank you, that's great news. If there's any help I can give with testing, please let me know.
@Dalusia this is my first time committing anything on GitHub, I'm not sure about the process here. It would make sense to have some tests for the string chunking function.
I'm also not sure how to put this change into the main development branch.
I've merged it and released fix in 2.23.1. Please let me know if the problem is gone.
As an aside - I'd like to give it to my students to test, but we've had to tell them to stop upgrading since so many of them ran into #363.
@Krzysztof-Cieslak Thank you. It works in the release for me.
OK, I assume this is fixed with @SoftwareApe's workaround. Closing this issue.
P.S. @Tyriar, I still believe that it should be fixed in VSCode (or at least documented somewhere)
I'm going to try and test this in the coming days. Once it's validated, @SoftwareApe you can claim the bounty.
So I went to check if the bug was fixed, and i realized/remembered that I don't have a machine that would reproduce this problem in the first place. >:(
After talking to @lilred about the bounty. I don't need it, and we agreed to give it to @Krzysztof-Cieslak for his great work here.
I'd suggest doing donation to FSSF or any charity / non-profit org you'd prefer instead.
That's a good suggestion, I think https://www.eff.org/ is also very important right now, as there needs to be someone defending our rights online.
Just had a chance to check this out, works perfectly for me.
I initially tried with a ridiculously long line of code, which caused some strange problems... but overall script length seems fine, my past examples (that used to trigger the issue) all pass fine now.
Many thanks to SoftwareApe & Krzysztof-Cieslak, as well as lilred and the others that provided input!
Most helpful comment
I've merged it and released fix in
2.23.1. Please let me know if the problem is gone.