Keep commands history and remeber cursor position.