Like a normal read, your input should break on the new line character "\n" and also on the up and down arrow keys. You will process the input made by the user when he/she enters new line.
Your shell must keep a history of the last 10 commands executed. When the user presses the up key the current input should show the last command executed (as the user typed it). So if the user executed the "ls" command, then pressed the up key, then pressed enter, the ls command should be executed. When the user presses up multiple times, you should replace the input with the next previous command. Until you reach the end of the history list (max of 10). If the user presses up and reaches the end of the list, the next time up is pressed nothing should happen. Conversely when the down arrow is pressed you should cycle through the history in the other direction. So if
the user presses down without pressing up, nothing should happen. That is because you will be at the bottom of the list. After a command is executed it should be added to the list and the index of where the user is in the history should be reset. This functionality should be similar to how the Bash shell works.