Occasionally the window is has random gibberish in it
bretthall opened this issue · comments
Description
Occasionally the window will have random characters show up at random locations.
Repro steps
Please provide the steps required to reproduce the problem
- Clone https://github.com/bretthall/workflow-demo
- Check out the
terminal-elmish-15
branch - Build and run the
device
project
Expected behavior
You should get a window that looks like this:
Actual behavior
Sometimes, within 30 seconds of the program starting, the screen will spontaneously change to the following:
If the issue doesn't happen in the first 30 seconds it doesn't seem to happen at all.
Known workarounds
Use 0.1.13 with work-arounds for issue #8
Related information
- Operating system: OSX
- Branch: 0.1.15
- .NET Runtime, CoreCLR or Mono Version: .net core 2.2
- Performance information, links to performance testing scripts
You don't need to rush to fix this in time for my Open F# talk, I can make things work with 0.1.13 fine.
@migueldeicaza do you have any idea, what could this be? race condition, when maybe other thread is used?
okay, maybe I try to use a mailbox processor to synchronize the dispatch calls. Maybe this is a thread problem or something.
I see the same. Repro:
- Clone the repo
dotnet run
theexamples/Elmish.Console.Elements
project- Go to the
TextFields
menu item - Enter
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
in the text box, holding down the key, then press backspace - again holding down the key - Things break and end up looking like this:
It's worth noting that if I then quit the application, strange characters keep being written to the terminal as below:
These characters are generated when I move the mouse and this stops happening as soon as I disable the "Enable mouse reporting" option in iterm. [EDIT: This is an unrelated issue, upon further investigation I can see that this happens when doing Program.quit regardless of whether subscriptions are in use.]
Initially, I wondered whether something like this would help: https://github.com/elmish/Elmish.WPF/blob/dd631813786db1cf2c473ab51d85e68f0f704d82/src/Elmish.WPF/Program.fs (more discussion here: elmish/Elmish.WPF#40).
I was barking up completely the wrong tree. I tried implementing the mailbox processor and this made no difference. I can see that when disabling subscriptions, the app starts working fine, so I suspect the problem is there...
Huge thanks for sharing the nice wrapper by the way!
Hi. I release a new version (0.1.6). I should fix this issue. A feedback would be nice. Thank you.
Nice! Yes this resolves the issue for me on mac - thanks for the quick fix!
It took me a moment to realise that I needed to remove the spurious Terminal.Gui.Elmish.dll reference, but once I had removed that and done dotnet add package Terminal.Gui.Elmish
it all worked perfectly.
Hopefully this resolves your issue too Brett.
edit: I really want to understand this line here! let t = Application.Current.GetType() = typeof<Terminal.Gui.Dialog>
ups forget this. was a debugging test ...
I removed this line from the master.
I close this issue
ups forget this. was a debugging test ...
Ah ok! I thought maybe you had to do a weird hack to force it to evaluate :D