docker exec -it --env COLUMNS=`tput cols` --env LINES=`tput lines` your_container_name /bin/bash

reference:

https://blog.csdn.net/DongGeGe214/article/details/86674741