Related question with working solution for linux based systems: Reading user input without echoing
The following code which is derived from one of the answers to above question is not working as expected for windows. I expected this function to not echo user input, but it is echoing user input:
get_password <- function() {
cat("Password: ")
#system("stty -echo")
system("echo off")
a <- readline()
#system("stty echo")
system("echo on")
cat("\n")
return(a)
}
I'm wondering if there is a way to read user input from R console while running an Rscript without actually showing it on the screen. Specifically I'm asking a solution that works in Windows OS.
Edit: I'm running my R 3.1.2 instance on Windows Server 2008 x64 and the above function is echoing the user input while it is asking for "Password: ".