Howto remove/fix “WARNING: terminal is not fully functional” in docker
How many times did you try to use top command in docker container and it didn’t work? or How many times did you try to use vim or less command and it didn’t work properly?
For me many times. Both me and you saw the following error/warning messages before and try to get rid of them.
This mini post will remove the following errors and all test-based programs inside a docker container will work just perfect.
For more details on docker TERM variable, check our complete article :
But for this mini post, here’s the error messages:
- For clear and top commands:
TERM environment variable not set.
- For less command:
WARNING: terminal is not fully functional
- For nano command:
Error opening terminal: unknown.
To solve those errors, we need to set the TERM variable inside our container. We have two options:
- Option 1: recreate the container from it’s image with
Here’s “if possible” delete the container and re-create it again with adding -t/–tty option to the
docker run command, as follow:
$ docker run -it --name centos_container centos /bin/bash
Now, all programs will work fine permanently.
- Option 2: Set the TERM variable inside your container.
Here’s we’ll add a TERM environment variable inside our container, this variable will solve this errors for current session and you need to add it again every time you connect to your container, Here’s the steps:
$ docker exec -it <a-docker-container> /bin/bash export TERM=xterm
Now, your container will work just as perfect for the current session.
If You Appreciate What We Do Here On Mimastech, You Should Consider:
- Stay Connected to: Facebook | Twitter | Google+
- Support us via PayPal Donation
- Subscribe to our email newsletters.
- Tell other sysadmins / friends about Us - Share and Like our posts and services
We are thankful for your never ending support.