Skip to content

[Bug]: wrong clie outputs on windows #2028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lordrak007 opened this issue Oct 11, 2024 · 8 comments
Open

[Bug]: wrong clie outputs on windows #2028

lordrak007 opened this issue Oct 11, 2024 · 8 comments
Assignees
Labels
bug needs triage Waiting for discussion / prioritization by team

Comments

@lordrak007
Copy link

Steps to Reproduce

download latest step and run in cli or powershell

Your Environment

  • OS - server 2022 or windows 11
  • step-ca Version -

Expected Behavior

Write output correctly

Actual Behavior

C:\Users\myuser\Desktop>step
←[0;1;99mNAME←[0m
←[0;1;99mstep←[0m -- plumbing for distributed systems

←[0;1;99mUSAGE←[0m
←[0;1;99mstep←[0m ←[0;4;39mcommand←[0m ←[0;4;39m[arguments]←[0m

←[0;1;99mOPTIONS←[0m
←[0;1;99m--help←[0m, ←[0;1;99m-h←[0m
show help

  ←[0;1;99m--config←[0m=←[0;4;39mvalue←[0m
      path to the config file to use for CLI flags

  ←[0;1;99m--version←[0m, ←[0;1;99m-v←[0m
      print the version

←[0;1;99mCOMMANDS←[0m
←[0;1;99mhelp, h←[0m display help for the specified command or command group
←[0;1;99mpath←[0m print the configured step path and exit
←[0;1;99mbase64←[0m encodes and decodes using base64 representation
←[0;1;99mcertificate←[0m create, revoke, validate, bundle, and otherwise manage certificates
←[0;1;99mcompletion←[0m print the shell completion script
←[0;1;99mcontext←[0m manage certificate authority contexts
←[0;1;99mcrl←[0m initialize and manage a certificate revocation list
←[0;1;99mcrypto←[0m useful cryptographic plumbing
←[0;1;99moauth←[0m authorization and single sign-on using OAuth & OIDC
←[0;1;99mversion←[0m display the current version of the cli
←[0;1;99mca←[0m initialize and manage a certificate authority
←[0;1;99mbeta←[0m commands that are being tested; these APIs are likely to change
←[0;1;99mssh←[0m create and manage ssh certificates

Additional Context

no

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@lordrak007 lordrak007 added bug needs triage Waiting for discussion / prioritization by team labels Oct 11, 2024
@dopey dopey self-assigned this Oct 15, 2024
@dopey
Copy link
Contributor

dopey commented Nov 8, 2024

Hey @lordrak007 👋, thanks for opening the issue.

I believe what you're seeing are color codes that aren't being correctly parsed by your terminal. We opened up this issue (smallstep/cli#648) a few years ago to track this feature request. Unfortunately, there hasn't been much engagement on that issue and, given our team size and other product focuses, we have to be very careful about only prioritizing those issues that would most benefit the community.

That said, we'd be happy to accept a PR from the community. If anyone is interested in working on this, let us know and we'd be happy to chat through it.

cheers 🍻

@dopey
Copy link
Contributor

dopey commented Nov 8, 2024

If it's ok with you, I will close this as a duplicate of the existing feature request.

@lordrak007
Copy link
Author

Hi, i think this is bug for latest version of step. Previoud release seems be ok.

@hslatman
Copy link
Member

hslatman commented Nov 8, 2024

Can you provide more specific information regarding your environment? E.g. (official) Windows version, PowerShell version, etc.

@sevenrats
Copy link

If you are experiencing this issue, please save the following script as a .ps1 file and run it using Powershell.

Write-Host "=== System Information ==="
systeminfo | Select-String "^OS Name|^OS Version"

Write-Host "`n=== Windows Version (ver) ==="
cmd.exe /c ver

Write-Host "`n=== PowerShell Version ==="
$PSVersionTable

Write-Host "`n=== Console Encoding ==="
Write-Host "OutputEncoding: $([Console]::OutputEncoding)"
Write-Host "InputEncoding : $([Console]::InputEncoding)"

Write-Host "`n=== .NET Encoding Defaults ==="
[System.Text.Encoding]::Default
[System.Text.Encoding]::ASCII
[System.Text.Encoding]::UTF8

Write-Host "`n=== Locale and Culture ==="
Get-Culture
Get-WinSystemLocale
Get-WinUserLanguageList

Write-Host "`n=== Code Page Info (chcp) ==="
cmd.exe /c chcp

Write-Host "`n=== Environment Variables Related to Encoding ==="
Get-ChildItem Env: | Where-Object { $_.Name -match 'LANG|LC_|CODEPAGE' }

@sevenrats
Copy link

It will output helpful info like this:

=== System Information ===

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19044 N/A Build 19044

=== Windows Version (ver) ===

Microsoft Windows [Version 10.0.19044.1865]

=== PowerShell Version ===

Key   : PSVersion
Value : 5.1.19041.1682
Name  : PSVersion


Key   : PSEdition
Value : Desktop
Name  : PSEdition


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name  : PSCompatibleVersions


Key   : BuildVersion
Value : 10.0.19041.1682
Name  : BuildVersion


Key   : CLRVersion
Value : 4.0.30319.42000
Name  : CLRVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


=== Console Encoding ===
OutputEncoding: System.Text.SBCSCodePageEncoding
InputEncoding : System.Text.SBCSCodePageEncoding

=== .NET Encoding Defaults ===

IsSingleByte      : True
BodyName          : iso-8859-1
EncodingName      : Western European (Windows)
HeaderName        : Windows-1252
WebName           : Windows-1252
WindowsCodePage   : 1252
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 1252


IsSingleByte      : True
BodyName          : us-ascii
EncodingName      : US-ASCII
HeaderName        : us-ascii
WebName           : us-ascii
WindowsCodePage   : 1252
IsBrowserDisplay  : False
IsBrowserSave     : False
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 20127


BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001


=== Locale and Culture ===

Parent                         : en
LCID                           : 1033
KeyboardLayoutId               : 1033
Name                           : en-US
IetfLanguageTag                : en-US
DisplayName                    : English (United States)
NativeName                     : English (United States)
EnglishName                    : English (United States)
TwoLetterISOLanguageName       : en
ThreeLetterISOLanguageName     : eng
ThreeLetterWindowsLanguageName : ENU
CompareInfo                    : CompareInfo - en-US
TextInfo                       : TextInfo - en-US
IsNeutralCulture               : False
CultureTypes                   : SpecificCultures, InstalledWin32Cultures, FrameworkCultures
NumberFormat                   : System.Globalization.NumberFormatInfo
DateTimeFormat                 : System.Globalization.DateTimeFormatInfo
Calendar                       : System.Globalization.GregorianCalendar
OptionalCalendars              : {System.Globalization.GregorianCalendar, System.Globalization.GregorianCalendar}
UseUserOverride                : True
IsReadOnly                     : False


Parent                         : en
LCID                           : 1033
KeyboardLayoutId               : 1033
Name                           : en-US
IetfLanguageTag                : en-US
DisplayName                    : English (United States)
NativeName                     : English (United States)
EnglishName                    : English (United States)
TwoLetterISOLanguageName       : en
ThreeLetterISOLanguageName     : eng
ThreeLetterWindowsLanguageName : ENU
CompareInfo                    : CompareInfo - en-US
TextInfo                       : TextInfo - en-US
IsNeutralCulture               : False
CultureTypes                   : SpecificCultures, InstalledWin32Cultures, FrameworkCultures
NumberFormat                   : System.Globalization.NumberFormatInfo
DateTimeFormat                 : System.Globalization.DateTimeFormatInfo
Calendar                       : System.Globalization.GregorianCalendar
OptionalCalendars              : {System.Globalization.GregorianCalendar, System.Globalization.GregorianCalendar}
UseUserOverride                : True
IsReadOnly                     : False


LanguageTag     : en-US
Autonym         : English (United States)
EnglishName     : English
LocalizedName   : English (United States)
ScriptName      : Latin
InputMethodTips : {0409:00000409}
Spellchecking   : True
Handwriting     : False


=== Code Page Info (chcp) ===
Active code page: 437

=== Environment Variables Related to Encoding ===

@tashian
Copy link
Contributor

tashian commented Apr 15, 2025

@sevenrats and can you confirm that you're experiencing this issue on a system with the output that you posted here?

@sevenrats
Copy link

@tashian yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

5 participants