Subject: | cls does not reset location as per documentation. |
This only clears the screen, but retains the terminal position where it was.
perl -MTerm::ANSIScreen=cls -E' cls '
perl -MTerm::ANSIScreen=cls -E' cls ' |& xxd
00000000: 1b5b 324a .[2J
For proper clear-screen emulation, one needs to do:
perl -MTerm::ANSIScreen=cls,locate -E' cls; locate(1,1)'
perl -MTerm::ANSIScreen=cls,locate -E' cls; locate(1,1)' |& xxd
00000000: 1b5b 324a 1b5b 313b 3148 .[2J.[1;1H