Summary
The general solution to this error is to set the environment variable TERM to xterm.
1
This is because the xterm-256color terminal type is not supported by the system.
It is recommended to use the xterm terminal type instead.
This should resolve the error.
According to