question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No line-drawing characters on kubectl exec session to Ubuntu

See original GitHub issue

Windows, and WSL (Ubuntu) work great:

image

When I connect to a container running on Kubernetes, on Linux (via kubectl exec -it MYPOD -n MYNAMESPACE -c MYCONTAINER -- /bin/bash), all looks grey at first:

image

Then I discovered it’s because TERM defaults to xterm. When export TERM=xterm-256color, I get this:

image

Compared to the first image, there’s definitely no line-drawing characters… but also maybe the bright white colour isn’t there either?

I’m using Windows Terminal, which apparently aims for xterm-256color support… and well, it works with WSL/Ubuntu with TERM=xterm-256color. I also tried just Windows PowerShell, which looks the same.

I also tried export LANG=en_US.UTF-8, or export NCURSES_NO_UTF8_ACS=1, both with no effect.

I’ve tried using other apps / writing general .NET code… k9s can render lines ok. Colour and emojis work fine with other apps.

I’m not sure if this is a gui.cs issue, but since other apps can render stuff ok, I thought I’d check in here. Maybe someone knows something else I could try? Thanks!

(Couldn’t be anything to do with https://github.com/migueldeicaza/gui.cs/commit/356b0f8618ea5b644c322c59808d7142d913c369 could it?)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:41

github_iconTop GitHub Comments

2reactions
kierenjcommented, Nov 22, 2021
  • IntPtr for setlocale had no effect
  • Swapping 0 and 6 for LC_ALL had no effect

Edit: discovered that the default .NET Core docker images use Debian 10, not Ubuntu. I created another VM with Debian 10, which worked. So we have:

Working: Windows, Ubuntu on WSL, Ubuntu VM, Debian 10 VM Not working: dotnet/aspnet:5.0 Docker image on Kubernetes (based on Debian 10 slim) via kubectl exec or ssh

Will try an Ubuntu-based Docker image on Kubernetes later today.

1reaction
thunder7553commented, Dec 14, 2022

One of the information I saw was here https://stackoverflow.com/questions/28405902/how-to-set-the-locale-inside-a-debian-ubuntu-docker-container.

The best workaround I used was:


	apt-get install -y locales && \
	sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    update-locale LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8 \
	TERM=xterm-256color

Thanks, that’s just what I needed (debian:bullseye-slim based image with .net 7)

Read more comments on GitHub >

github_iconTop Results From Across the Web

No line-drawing characters on kubectl exec session to ...
I'm using Windows Terminal, which apparently aims for xterm-256color support.. and well, it works with WSL/Ubuntu with TERM=xterm-256color . I ...
Read more >
How to increase the characters per line when using kubectl ...
but if I input about 70 characters in bash and then I get truncated output and line broken anyway lead to unreadable. is...
Read more >
Some things you didn't know about kubectl
kubectl is the command line tool for interacting with Kubernetes clusters. Many people use it every day to deploy their container workloads ...
Read more >
SQL output piped to `kubectl exec` crashes, if not replacing ...
The context: I'm generating SQL from a backup dump, inside a subshell, to then pipe it to mysql for execution:
Read more >
8 Kubernetes Tips and Tricks
In this article, we're going to explore a few tips and tricks that will make it easier to work with Kubernetes. Most of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found