added support for history and use of arrow keys while using the prompt.