Cannot display long Kubernetes token without truncation #9861

Closed
opened 2026-01-31 02:05:47 +00:00 by claunia · 5 comments
Owner

Originally created by @komodovaran on GitHub (Jul 26, 2020).

Environment

Windows Terminal version 1.0.1811.0
Powershell Version 7.0.3

Steps to reproduce

Kubernetes relies on an extremely long token (like 900 characters) to be copy-pasted into the browser window to open up a dashboard. When this token is generated through Windows Terminal, it is cut off at the window width.

It does, however, work with the Powershell standalone terminal, where no truncation occurs. Instead, a horizontal scrollbar appears.

Other things in Windows Terminal are not cut off, such as echo extremelylongstring, but are wrapped.

Originally created by @komodovaran on GitHub (Jul 26, 2020). # Environment ``` Windows Terminal version 1.0.1811.0 Powershell Version 7.0.3 ``` # Steps to reproduce Kubernetes relies on an extremely long token (like 900 characters) to be copy-pasted into the browser window to open up a dashboard. When this token is generated through Windows Terminal, it is cut off at the window width. It does, however, work with the Powershell standalone terminal, where no truncation occurs. Instead, a horizontal scrollbar appears. Other things in Windows Terminal are not cut off, such as `echo extremelylongstring`, but are wrapped.
Author
Owner

@DHowett commented on GitHub (Jul 26, 2020):

So, this is pretty weird. We wrap by default, unless an application explicitly requests that we truncate. I bet the runtime Kubernetes is using has never been vetted to work with a locked console buffer (which is a completely valid way to configure the windows console...)

@DHowett commented on GitHub (Jul 26, 2020): So, this is pretty weird. We wrap _by default_, unless an application explicitly requests that we truncate. I bet the runtime Kubernetes is using has never been vetted to work with a locked console buffer (which is a completely valid way to configure the windows console...)
Author
Owner

@DHowett commented on GitHub (Jul 27, 2020):

Would you mind sharing a screenshot or a snippet of text that's related to the token? I'd like to figure out where in the K8s source it's being printed and what they're doing wrong.

In general, applications that attempt to add a horizontal scroll bar to WT are just not going to work. They're explicitly trying to break line wrapping, and that's really just them telling you that it's their computer, not yours, where you get the final say.

@DHowett commented on GitHub (Jul 27, 2020): Would you mind sharing a screenshot or a snippet of text that's related to the token? I'd like to figure out where in the K8s source it's being printed and what they're doing wrong. In general, applications that attempt to add a horizontal scroll bar to WT are just not going to work. They're explicitly trying to break line wrapping, and that's really just them telling you that it's _their computer_, not yours, where you get the final say.
Author
Owner

@komodovaran commented on GitHub (Jul 28, 2020):

I dug around a bit in the scripts and it seems Kubernetes is not to blame. Actually, this PowerShell is:
[Console]::BufferWidth = $long_text+10; Write-Host $long_text

And then output with Write-Host. This bypasses line-wrapping, and therefore breaks in Windows Terminal.

Sorry for the confusion!

@komodovaran commented on GitHub (Jul 28, 2020): I dug around a bit in the scripts and it seems Kubernetes is not to blame. Actually, this PowerShell is: `[Console]::BufferWidth = $long_text+10; Write-Host $long_text` And then output with Write-Host. This bypasses line-wrapping, and therefore breaks in Windows Terminal. Sorry for the confusion!
Author
Owner

@DHowett commented on GitHub (Jul 31, 2020):

Unfortunately, if Kubernetes is relying on the ability to set the buffer size to be an absurd width they're going to need to not do that 😄

This may just be a duplicate of #5094, with the added bonus that the application has an annoying behavior if you reject its resize request.

@DHowett commented on GitHub (Jul 31, 2020): Unfortunately, if Kubernetes is relying on the ability to set the buffer size to be an absurd width they're going to need to not do that :smile: This may just be a duplicate of #5094, with the added bonus that the application has an annoying behavior if you reject its resize request.
Author
Owner

@ghost commented on GitHub (Aug 4, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 4, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9861