我使用命令:docker run –rm -it govim bash -l来运行docker images但是
它不显示颜色输出.如果我使用〜/ .bash_profile或再次运行bash -l,则输出将正确地输出颜色.
My bash_profile and bash_prompt
解决方法:
OP SolomonT报告docker run
和env
工作:
docker run --rm -it -e "TERM=xterm-256color" govim bash -l
并且Fernando Correia添加了in the comments:
To get both color support and make
tmux
work, I combined both examples:
docker exec -it my-container env TERM=xterm-256color script -q -c "/bin/bash" /dev/null
正如chepner评论(早期回答),.bash_profile来源(它是一个交互式shell),因为bash_prompt
是called by .bash_profile
.
但docker issue 9299说明TERM似乎没有立即设置,迫使用户打开另一个bash:
docker exec -ti test env TERM=xterm-256color bash -l
您与issue 8755有类似的颜色问题.
至illustrate/reproduce the problem:
docker exec -ti $CONTAINER_NAME tty
not a tty
docker exec -ti `your_container_id` script -q -c "/bin/bash" /dev/null
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。