Skip to content

cli: Color on windows doesn't workΒ #3068

Closed

Description

@mateon1

Version/Platform/Processor information:
go-ipfs version: 0.4.3-rc2-
Repo version: 4
System version: amd64/windows
Golang version: go1.6.2

Type: bug
Area: commands/logging/cli
Priority: P1

Description:
The ipfs tool on windows doesn't display colors properly, even though the default cmd.exe supports ANSI escape codes with no problem.

Example daemon error message:

Windows colors demonstration:

Activity

  1. added
    kind/bugA bug in existing code (including security flaws)
    help wantedSeeking public contribution on this issue
    on Aug 9, 2016
  2. whyrusleeping commented on Aug 9, 2016

    @whyrusleeping
    Member

    thanks for reporting, The output in the colored.txt matches what i get from ipfs on a linux box. Could you try doing ipfs daemon --debug 2> output.txt and show the hexdump of that?

  3. mateon1 commented on Aug 10, 2016

    @mateon1
    ContributorAuthor

    Apparently, the windows terminal only accepts ANSI escape codes with a specific flag enabled:
    "The following terminal sequences are intercepted by the console host when written into the output stream if the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag is set on the screen buffer handle using the SetConsoleMode flag."
    (https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx)
    Example usage in Go: https://github.com/jfrazelle/binctr/blob/master/vendor/github.com/docker/docker/pkg/term/term_windows.go

  4. djdv commented on Aug 15, 2016

    @djdv
    Contributor

    Referencing old duplicate:
    #2124

  5. leerspace commented on Nov 26, 2017

    @leerspace
    Contributor

    Since go-log is using a modified version of go-logging, maybe we can update the customized version with the changes in op/go-logging#110 once the PR for it is merged.

    edit: it looks like the op/go-logging repo may not be active, so maybe waiting for the changes to be merged upstream isn't a good option.

  6. djdv commented on Jun 3, 2018

    @djdv
    Contributor

    Resolved in: #5007

  7. ghost removed
    status/deferredConscious decision to pause or backlog
    on Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)topic/windowsWindows specific

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions