Skip to content

no colour in vim in a Docker container when using contour #1244

@Yaraslaut

Description

@Yaraslaut

Discussed in #1240

Originally posted by mufasachan October 9, 2023
I edit files in running containers using Vim, primarily for prototyping a Dockerfile. I recently installed contour, and it's fantastic. However, when I edit files in my container with Vim, the colors are missing. I suspect I may have overlooked something in the configurations (either Docker or contour).


When I execute the following commands:

docker run -it debian:stable-slim bash
>> apt update && apt install -y vim
>> vim

I don't see any colors when editing a file, for instance, .bashrc. The main screen also lacks colors. If I try to view highlight groups (:hi), the list of all highlight groups appears, but it's entirely in black and white.

Moreover, I've noticed that executing any command in the bash within the container works fine. For example:

# In container
>> ls --color
>> echo -e "\e[31mRed Text\e[0m"

I've added this post to the discussion as I don't believe the issue is related to Contour. I suspect my lack of understanding regarding terminal emulators and Docker is the cause. If you can identify or replicate this behavior and investigate why it doesn't work, I would be greatly appreciative 😁 .

I wonder why the container's bash seems to handle colors well, while Vim within the container fails to output colors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions