console.py: support keyboard arrow keys for editing, history