Handling for moving the cursor within the command line and other things