Skip to content
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

The command crc status -w on Windows writes out escape codes #3936

Closed
jeffmaury opened this issue Dec 4, 2023 · 13 comments
Closed

The command crc status -w on Windows writes out escape codes #3936

jeffmaury opened this issue Dec 4, 2023 · 13 comments
Assignees
Labels
kind/bug Something isn't working os/windows

Comments

@jeffmaury
Copy link

General information

  • OS: Windows
  • Hypervisor: Hyper-V
  • Did you run crc setup before starting it (Yes/No)? Yes
  • Running CRC on: Laptop

CRC version

CRC version: 2.28.0+e1f42d
OpenShift version: 4.13.14
Podman version: 4.4.4

CRC status

DEBU CRC version: 2.28.0+e1f42d
DEBU OpenShift version: 4.13.14
DEBU Podman version: 4.4.4
DEBU Running 'crc status'
CRC VM:          Running
OpenShift:       Starting (v4.13.14)
RAM Usage:       5.859GB of 9.361GB
Disk Usage:      19.41GB of 32.68GB (Inside the CRC VM)
Cache Usage:     29.51GB
Cache Directory: C:\Users\Jeff\.crc\cache

CRC config

- consent-telemetry                     : yes

Host Operating System

Nom de l'h鍍e:                              DESKTOP-JEFF
Nom du syst確e d'exploitation:              Microsoft Windows 11 Professionnel
Version du syst確e:                         10.0.22621 N/A build 22621
Fabricant du syst確e d'exploitation:        Microsoft Corporation
Configuration du syst確e d'exploitation:    Station de travail autonome
Type de build du syst確e d'exploitation:    Multiprocessor Free
PropriUaire enregistr・                    Jeff MAURY
Organisation enregistrF:                   
Identificateur de produit:                  00330-80819-37372-AA576
Date d'installation originale:              09/11/2022, 16:39:06
Heure de dNarrage du syst確e:              04/12/2023, 15:54:02
Fabricant du syst確e:                       LENOVO
Mod獲e du syst確e:                          20TJS2F43N
Type du syst確e:                            x64-based PC
Processeur(s):                              1 processeur(s) install・s).
                                            [01]: Intel64 Family 6 Model 165 Stepping 2 GenuineIntel ~2310 MHz
Version du BIOS:                            LENOVO N2VET29W (1.14 ), 15/03/2021
RQertoire Windows:                         C:\Windows
RQertoire syst確e:                         C:\Windows\system32
PSiphSique d'amor㌢ge:                    \Device\HarddiskVolume1
Option rHionale du syst確e:                fr;Fran㌢is (France)
Param閣res rHionaux d'entrF:              fr;Fran㌢is (France)
Fuseau horaire:                             (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris
MNoire physique totale:                    32525 Mo
MNoire physique disponible:                10370 Mo
MNoire virtuelle: taille maximale:        45586 Mo
MNoire virtuelle: disponible:             19831 Mo
MNoire virtuelle: en cours d'utilisation: 25755 Mo
Emplacements des fichiers d'Dhange:        C:\pagefile.sys
Domaine:                                    WORKGROUP
Serveur d'ouverture de session:             \\DESKTOP-JEFF
Correctif(s):                               4 Corrections installFs.
                                            [01]: KB5032007
                                            [02]: KB5012170
                                            [03]: KB5032190
                                            [04]: KB5032393
Carte(s) rTeau:                            5 carte(s) rTeau installF(s).
                                            [01]: Intel(R) Wi-Fi 6 AX201 160MHz
                                                  Nom de la connexion: Wi-Fi
                                                  DHCP activ・:         Oui
                                                  Serveur DHCP:        192.168.1.254
                                                  Adresse(s) IP
                                                  [01]: 192.168.1.187
                                                  [02]: fe80::5102:6cd:7e09:85b2
                                                  [03]: 2a01:e34:ec7e:3020:349b:1d9d:c826:b6f4
                                                  [04]: 2a01:e34:ec7e:3020:5116:66ca:8d7a:292a
                                            [02]: Bluetooth Device (Personal Area Network)
                                                  Nom de la connexion: Connexion rTeau Bluetooth
                                                  腎at:                Support dDonnect・
                                            [03]: Wintun Userspace Tunnel
                                                  Nom de la connexion: OpenVPN Wintun
                                                  腎at:                Support dDonnect・
                                            [04]: TAP-Windows Adapter V9
                                                  Nom de la connexion: OpenVPN TAP-Windows6
                                                  腎at:                Support dDonnect・
                                            [05]: OpenVPN Data Channel Offload
                                                  Nom de la connexion: OpenVPN Data Channel Offload
                                                  腎at:                Support dDonnect・
Configuration requise pour Hyper-V:         Un hyperviseur a U・dUect・ Les fonctionnalitT nDessaires ・Hyper-V ne seront pas affichFs.

Steps to reproduce

  1. crc start
  2. crc status -w

Expected

Actual

daemon

Logs

Before gather the logs try following if that fix your issue

$ crc delete -f
$ crc cleanup
$ crc setup
$ crc start --log-level debug

Please consider posting the output of crc start --log-level debug on http://gist.github.com/ and post the link in the issue.

@anjannath
Copy link
Member

@jeffmaury does it behave the same in the powershell window as well or this happens only in the windows terminal app?

@gbraad
Copy link
Contributor

gbraad commented Dec 5, 2023

These are escape codes (that are not interpreted correctly. And as it looks like, you are running the command prompt cmd instead of powershell.

I do not think this is a situation with a high priority, as crc status works otherwise perfectly.

@jeffmaury
Copy link
Author

daemon1

@gbraad
Copy link
Contributor

gbraad commented Dec 5, 2023

@anjannath how about Mac?

@anjannath
Copy link
Member

anjannath commented Dec 5, 2023

in macOS its fine, escape codes are being rendered properly..

Image

@gbraad
Copy link
Contributor

gbraad commented Dec 5, 2023

So it is the color. Perhaps a solution could be to make it all colorless or not for GOOS=Windows

/cc: @evidolob WDYT?

@evidolob
Copy link
Contributor

evidolob commented Dec 5, 2023

Yes we could do that, perhaps, even detect if terminal supports color, and add only if terminal supports colours

@evidolob evidolob self-assigned this Dec 5, 2023
@evidolob
Copy link
Contributor

evidolob commented Dec 5, 2023

It seems that Windows 10(from build 10586) does support colours in terminal, we need to enable it.
We could use https://github.com/jwalton/go-supportscolor to add detection of color support on any supported OS, lib will also enable color support on windows.

@gbraad WDYT?

@cfergeau
Copy link
Contributor

cfergeau commented Dec 5, 2023

https://github.com/crc-org/crc/blob/main/pkg/os/terminal/terminal.go provides support to check if we run in a terminal or not, this could be extended to check if color output is supported.

@gbraad
Copy link
Contributor

gbraad commented Dec 6, 2023

@evidolob add a check to see if color support is available. We can otherwise use an override structure with _windows.go if not working as expected.

Note: this is low priority and perhaps something @vyasgun can do?

@vyasgun
Copy link
Contributor

vyasgun commented Dec 6, 2023

/assign

@gbraad gbraad changed the title crc status -w gives strange output on Windows The command crc status -w on Windows writes out escape codes Dec 6, 2023
@vyasgun
Copy link
Contributor

vyasgun commented Jan 2, 2024

When I sent a ctrl-c after the bars start printing, I could see the expected output:
image

The problem seems to be with the progressbar pool as I am not running into this when I am printing the progress bar independently.

@anjannath
Copy link
Member

fixed in #3955

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working os/windows
Projects
Status: Done
Development

No branches or pull requests

6 participants