Instead of for(i in 1:10){ cat(i);} cat("end","\n") try wrapping your statements inside braces. That way R will see only a single statement---the braced expression---and the prompt will be generated. { for(i in 1:10){ cat(i);} cat("end","\n") }