Closed jinlow closed 2 years ago
Thank you for this bug report and for the reproducible example code. I think this is caused by httpgd waiting for the R session to finish executing, but it is not intended behavior. I will see what I can do.
Original issue: https://github.com/REditorSupport/vscode-R/issues/813.
This is caused by later
preventing calling R when there is something on the call stack https://github.com/r-lib/later/issues/159
We have to wait if the later
devs consider adding functionality to disable this check. Otherwise we would have to implement a complete later
replacement for httpgd at some point. As this is platform dependent low level C code I want to avoid this when possible.
Describe the bug
I have a package that has some interactivity, that depends on being able to display plots in a loop. In RStudio, all plots display, but in an httpgd session they are not, only the first plot, and then all of them after the interactivity ends.
To Reproduce
The following R code run in a vanilla R session, only the first plot is displayed, subsequent plots are not displayed until "q" is pressed.
Expected behavior
I would expect all of the plots to display interactively, every time "p" is entered a new plot would be displayed.
Screenshots
Here I have pressed "p" several times and only one plot is printed.
Only after pressing "q" and the loop ending, are all the plots displayed.
Environment