This question already has an answer here:
In a linux terminal I use "cat > file.txt" to make a file one line at a time.
What I find is that per-line the delete key works but the arrow keys insert escape codes rather than moving left and right in the line.
Why is this? Is there a reason that the terminals basic action cannot do left and right arrow keys? I know there are things like GNU readline which do it but my question is not about those.