support chat input history with arrow keys