这是indexloc提供的服务,不要输入任何密码
Skip to content

Weird formatting on Bash on Ubuntu running in Windows using WSL when VirtualTerminalLevel is 1 #18

@gboor

Description

@gboor

This is quite a weird one that I ran into a while ago when using Helm. The original ticket can be found here;

helm/helm#8242

When using Bash on Ubuntu in Windows using WSL, apparently the terminal is still rendered using underlying Windows components. If the registry setting HKCU\Console\VirtualTerminalLevel is set to 1, the spacing of the tables get messed up.

HKCU\Console\VirtualTerminalLevel is normally not set, or set to 0. It needs to be set to 1 in order to enable ANSI color sequences in Windows CLI, which is why I had it set. Changing the setting back to 0 fixed the spacing issue.

I think this means that the tabling sends certain control characters that mess up the spacing somehow.

Image;
tty

Note that kubectl output is just fine, even with this setting set. I understood from the Helm team (see original ticket) that they use some custom formatter.

I realize this is a very obscure issue, but it should be easy enough to reproduce on Windows 10 with WSL and Ubuntu. Just set the registry key, open a new bash window and try some tabled output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions