Giter Club home page Giter Club logo

Comments (13)

UmanShahzad avatar UmanShahzad commented on August 24, 2024 1

@gvanem I imagine this'd be an issue for any terminal emulator which either doesn't support or has disabled via config the interpreting of these codes. So the solution you're recommending isn't generic enough and we'll likely get another issue later for a different emulator.

I'll just add a flag & NO_COLOR env var support as @Calinou mentioned to disable outputting color codes, and you can turn that on.

As a side note:

Could someone in 2021 please detect that such codes are effective before using them?

This attitude is unwarranted. We'll make the change, but you could word it more respectfully.

from cli.

UmanShahzad avatar UmanShahzad commented on August 24, 2024 1

Is this related to the "pretty" format?

@glittle No, but if you use json/csv format then no colors will be displayed.

Just obscure errors like

@gvanem Nothing obscure about it. Your golang installation isn't right.

from cli.

wasi-master avatar wasi-master commented on August 24, 2024 1

@UmanShahzad PR with what exactly? editing the readme to include this?

from cli.

Calinou avatar Calinou commented on August 24, 2024

The coloring is handled by fatih/color, so I doubt the CLI developers have any control over this.

All we could do is obey the NO_COLOR environment variable and disable colors if it's set to 1. Alternatively, a --no-color option could be added as follows: https://github.com/fatih/color#disableenable-color

Mine does, but I've turned that off for various reasons.

Could you explain why? I don't remember ANSI codes breaking anything on Windows 10. Windows versions below 10 don't support ANSI codes though.

from cli.

gvanem avatar gvanem commented on August 24, 2024

Could you explain why?

Since I use 4NT as my shell (since 20 years ago). Microsloth's cmd is just crap.

from cli.

glittle avatar glittle commented on August 24, 2024

Is this related to the "pretty" format?

Apparently that is on by default, and can be turned on with -p

Is there a way to turn it off?

from cli.

glittle avatar glittle commented on August 24, 2024

On a fresh install of Windows 10, I see the ANSI codes.

from cli.

gvanem avatar gvanem commented on August 24, 2024

On a fresh install of Windows 10, I see the ANSI codes.

Since the VT-emulation is default. But like I wrote, those new VT-console functions messes up my shell big time.

But I tried to modify vendor\github.com\mattn\go-colorable\colorable_windows.go to disable this non-sense.
But rebuilding ipinfo.exe fails; none of the steps in README.md works. Just obscure errors like:
build github.com/ipinfo/cli/ipinfo: cannot load io/fs: malformed module path "io/fs": missing dot in first path element.

from cli.

UmanShahzad avatar UmanShahzad commented on August 24, 2024

Added support for the --nocolor flag and the NO_COLOR environment variable in https://github.com/ipinfo/cli/releases/tag/ipinfo-1.1.1

Let me know if there's still any issues.

from cli.

wasi-master avatar wasi-master commented on August 24, 2024

You can see this comment on stackoverflow to enable ANSI escape sequences in the windows command prompt, I tried this myself and it works. I think this should be in the readme

Edit: you can also do that with this command:

REG ADD HKCU\CONSOLE /f /v VirtualTerminalLevel /t REG_DWORD /d 1

from cli.

UmanShahzad avatar UmanShahzad commented on August 24, 2024

@wasi-master Interesting, can you make a PR?

from cli.

UmanShahzad avatar UmanShahzad commented on August 24, 2024

@wasi-master Yes, if you want.

from cli.

wasi-master avatar wasi-master commented on August 24, 2024

I think I'll just wait until #24 is merged

Edit: did it anyways

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.