[PROBLEM] Issues with Using vi to Edit Files in CTF Environment - Insert Mode and Terminal Compatibility Problems

I made the “Solidstate” machine earlier and successfully penetrated it.
But I could not edit the file “tmp.py” for the Privilege Escalation with Vi or Nano, because supposedly my shell is not compatible with it.
As soon as I pressed the arrow keys, these entries appeared at the top left of the screen and when I wanted to enter something, the things were simply replaced…
there was also no insert mode
I even had a TTY shell in my opinion.
Can you perhaps help me further?
Greetings Nobody