When I launch a docker container using ‘exec’ command inside tmux, sometimes I experience weird behaviour of terminal:
- The size of terminal within container is not the same as size of tmux pane.
- When I try to search for command history with upper arrow key, the searched command would not be displayed in the terminal.
Here is solution for the behaviour. I basically pass the size of terminal that a container should create.
docker exec -ti --env COLUMNS=`tput cols` --env LINES=`tput lines` junyonglee_tf /bin/zsh