Bobcares

Docker Error Opening Terminal Unknown – Quick fix!

by | Jul 21, 2020

Docker error opening terminal unknown occurs when we try to enter the docker container and run basic bash commands.

Here at Bobcares, we have seen several causes for this error while troubleshooting Docker issues as part of our Server Management Services for web hosts and online service providers.

Today we’ll take a look at the cause for this error and how to fix it.

 

Why does Docker error opening terminal unknown occur

Before getting into the solution part, let us now discuss why does this error occur.

Normally, this error occurs when we open the container using the below command and try to run programs like top, less, nano, or vim.

docker exec -ti <container-name> bashCopy Code

The reason for this error is that the programs like the top, less or vim uses terminal information to fill the screen and recognize the keys that we hit. In case, if this information is incorrect, the screen will get messed up or keys will not be recognized.

For instance, the error appears as below.

Docker Error Opening Terminal Unknown

 

How we fix Docker error opening terminal unknown

Recently, one of our customers approached us telling us that he was able to enter the container via

sudo docker exec -t -i {container_name} bashCopy Code
command. But after trying to run
nanoCopy Code
, he received the below error.

Error opening terminal: unknown.

Now, let’s see how our Support Engineers resolve this error.

The easy and quick solution that we provide to our customers is that after entering the container we set the TERM environment variable to xterm.

To enter the container, we run the below command.

docker exec -ti <a-docker-container> bashCopy Code

Then to set the TERM environment variable to xterm. For that, we ran the following command.

export TERM=xtermCopy Code

This instantly fixed the error.

[Need any further assistance in fixing Docker errors? – We’re available 24*7]

 

Conclusion

In short, this Docker error occurs when we open the container and try to run basic bash commands. Today, we saw how our Support Engineers resolve this error to our customers.

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

Are you using Docker based apps?

There are proven ways to get even more out of your Docker containers! Let us help you.

Spend your time in growing business and we will take care of Docker Infrastructure for you.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Speed issues driving customers away?
We’ve got your back!