VI Editor is not properly working and getting special character while moving my mouse here and there

VI Editor is not properly working and adding extra special character while while moving my mouse in the below file. I am not sure why it is behaving like this. Please advise and help. Thanks!

Topic : The Client Demonstration
Task 5 : Add an entry host “all all 0.0.0.0/0 md5” to the end of the file /etc/postgresql/10/main/pg_hba.conf on the DB server.

sudo vi /etc/postgresql/10/main/pg_hba.conf

happens a lot. you can use the cat >> command.