Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange characters in VSCode FSharp Interactive terminal

I try to play with fsharp under Ubuntu (and yes, I slowly figure out that it is more pain than fun), I already installed Mono, VSCode and Ionide extension and I can create and build F# projects. Unfortunately when I run simple F# script via F# Interactive:

printfn "bar"

In terminal window I get:

>
- printfn "bar"
-
- ;;
bar
val it : unit = () F# 4.0 (Open Source Edition)
> ^?^?414;3R^?^?^?^?^?^? the Apache 2.0 Open Source License

The strange sequence ^?^? looks like unrecognized terminal escape codes, but when I use bash from within VSCode there is nothing like this.

What's more the strange sequence reappears after every command executed in FSI:

> let j = 9;;

val j : int = 9

> printfn "foo";;
foo
val it : unit = ()
> ^?^? 

Does anyone have the same problem and knows a solution (or maybe just knows a solution)?

EDIT: Problem occurs mostly when I execute commands via Ionide Alt+Enter shortcut

like image 457
csharpfolk Avatar asked Feb 12 '17 20:02

csharpfolk


People also ask

How do I get terminal on right side in Vscode?

Use the View > Terminal menu command. From the Command Palette (Ctrl+Shift+P), use the View: Toggle Terminal command.


1 Answers

This looks like the https://github.com/Microsoft/vscode/issues/19766 bug. VS Code 1.9 introduced a new setting, terminal.integrated.flowControl, that defaults to true. The ^? characters you're seeing (and any ^S and ^Q characters that might show up) come from this "flow control" feature, which doesn't play well with F# Interactive. Change your VS Code settings to set terminal.integrated.flowControl to false and your problem should go away.

like image 156
rmunn Avatar answered Nov 09 '22 14:11

rmunn