New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F# interactive command history is off by one #4584

Closed
jwosty opened this Issue Apr 16, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@jwosty

jwosty commented Apr 16, 2018

I don't see this issue filed elsewhere, but this has been present for a while for me. I'm running VS for Mac on OSX.

In F# interactive, when you press the up-arrow, it wrongly starts at the second to last command you entered instead of the last command. To reproduce:

1) Fire up VS for Mac (I assume the problem is also present in MD/XS).
2) In F# interactive, enter printfn "1st line"
3) Enter printfn "2nd line"
4) Press the up-arrow once, and notice that it jumps to printfn "1st line".

This actually isn't correct; see these steps instead.

The history is all there -- if you then press the down arrow once, it indeed fills in printfn "2nd line".

VS bug #601374

@nosami nosami self-assigned this Apr 16, 2018

@nosami nosami added this to the 15.8 milestone Apr 16, 2018

@jwosty

This comment has been minimized.

jwosty commented Apr 26, 2018

So I've been investigating further, and reproduction is actually a little more tricky than I thought. It's only off by one after something happens, and it stays this way for the rest of the session (even after you reset the session). It always seems to involve some amount of sending things to interactive. After some playing around, here's a set of minimum steps that definitely ruin a session:

  1. Directly enter 1;;
  2. Directly enter 2;;
  3. Highlight + send the following to interactive (cmd+enter) from a script file:
let f x =
    printfn "a"
    printfn "b"
    printfn "x = %s" x
  1. Highlight + send the following to interactive (cmd+enter) from a script file:
f "foo"
  1. Now, observe the the up-arrow fills in 1;;, when it should be 2;;. Session now seems to be permanently off by one on further invocations (e.g. try directly entering another line and pressing up arrow)

Also, I've confirmed that this is definitely present in MonoDevelop (not just some kind of weird VS for Mac issue).

@nosami

This comment has been minimized.

Member

nosami commented May 11, 2018

Can confirm. I've been aware of this behaviour for a while but it was quite low down on the list of priorities. I'll take a look into it now.

@jwosty

This comment has been minimized.

jwosty commented May 16, 2018

@nosami yeah, it's just one of those little things that has added up to make F# quite annoying to use in VS for Mac. This would help so much with the UX!

nosami added a commit that referenced this issue May 21, 2018

nosami added a commit that referenced this issue May 21, 2018

nosami added a commit that referenced this issue May 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment