Ignore leading spaces in REPL

Fix #1732.