Closed albertoarcagni closed 4 years ago
I cannot reproduce what you observe. Would you like to elaborate or provide some screenshots?
run R in the terminal write some code in the terminal, for instance print a dataframe clear the terminal (ctrl+shift+p and write the command terminal: clear) now run the code from the script (in this example I run the source with ctrl+shift+s but there is the same problem if you run only one line or the selection) the cleaned code in the terminal reappears
vscode-R does nothing about terminal context storage. I guess it is an issue of VSCode terminal under Windows. @andycraig any idea on this?
I'm sorry,
I confirm that it is a vscode problem: after your reply, I tested with python and there is the same problem and I found many bug-reports not solved and closed about it, for instance: https://github.com/microsoft/vscode/issues/81299
I also observed that the R function shell("cls") solves the problem in windows (and maybe some other arguments are necessary for other OS).
Therefore, before closing this issue I would like to ask you if you can integrate a shortcut to run it.
Best Alberto
PS: previously I noticed another issue in Windows with the Italian keyboard (https://github.com/Ikuyadeu/vscode-R/issues/145) that it was due to Rterm.exe, therefore, I reported it to the R developers (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17679) now solved in R version 4.0.0. I really desire an RStudio alternative!
You may take a look at https://github.com/Ikuyadeu/vscode-R/wiki/Keyboard-shortcuts#creating-keybindings-for-r-commands and create your own command shortcut keys by yourself.
thank you
PS: I added this shortcut in keybindings.json { "description": "clear R console in Windows", "key": "ctrl+alt+l", "command": "r.runCommand", "args": "shell('cls')" }
PS: previously I noticed another issue in Windows with the Italian keyboard (#145) that it was due to Rterm.exe, therefore, I reported it to the R developers (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17679) now solved in R version 4.0.0.
@arcalb Thank you for this update! Good on you for reporting it to the R team and I'm pleased to hear it was resolved. I'll copy this over to the original issue too.
VSCode Version: March 2020 (version 1.44) VSCode-R Version: 1.3.0 OS Version: Windows 10 1909 (italian)
Create an R file and run R in vscode Run the vscode command "Terminal: clear" and observe that the terminal clears Run the source or a line the R code is executed but the cleared code reappears