×


Fix Docker Error opening terminal unknown

Most Server Users experience Docker error opening terminal unknown in the process of accessing the docker container or when they want to use bash commands in the Linux ssh environment.


In this context, we will look into the main causes of this error and how to solve it.


What triggers Docker error opening terminal unknown?

This issue has to do with imputing commands incorrectly. Therefore, when we use ssh features such as sudo, nano, vim, top, care needs to be taken to ensure that it is used correctly. In a case where it not used the right way, the Docker error will appear.


How to fix Docker error opening terminal unknown

A while ago, one of our clients who was trying to access a Docker container with the bash command below experienced the following;


sudo docker exec -t -i {name_of_container} bash


After using the command, he entered "nano" on the command prompt and got an error message as seen below;


Error opening terminal: unknown.


To fix this issue, we have to first access the affected container to set the TERM variable to xterm.


We used the following command;


docker exec -ti <a-docker-container> bash


And after that , we run the following command in order to change the TERM environment variable to xterm as previously advised;


export TERM=xterm


This finally resolved the Docker issue.


Need support in Solving Docker issues? Reach us today.

Conclusion

Our Server Support team here at IbmiMedia has helped numerous clients to solve Docker related issues as part of our Linux Support Services.