Coder Social home page Coder Social logo

cli-utils's People

Contributors

azazeal avatar dependabot[bot] avatar dopey avatar github-actions[bot] avatar hslatman avatar maraino avatar tashian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli-utils's Issues

Broken terminal state on Windows for dependencies using this lib

Since f41a85a, Caddy users on Windows have had their terminals break after running any caddy CLI command, because the console mode never gets reset.

See caddyserver/caddy#4251 for details.

I suggest that the code in ui/ui_windows.go is changed to only get invoked at the CLI entrypoints for smallstep instead of inside of an init() so that it doesn't clobber terminal state. Ideally, for smallstep users, the terminal state should get reset before the commands exit as well.

This could be done with a ui_other.go which is a no-op on other platforms than Windows, and both have setupTerminalState() and cleanupTerminalState() functions (or whatever name best fits) which get called only for Smallstep's CLI.

Caddy uses cli-utils indirectly through these dependencies:

$ go mod why go.step.sm/cli-utils/ui
# go.step.sm/cli-utils/ui
github.com/caddyserver/caddy/v2/modules/caddypki
github.com/smallstep/certificates/authority
github.com/smallstep/certificates/kms
github.com/smallstep/certificates/kms/softkms
go.step.sm/cli-utils/ui

Credit to https://github.com/egonelbre for spotting the cause of the issue, and https://github.com/Mohammed90 for exploring a workaround.

Proposal: Use github.com/mgutz/ansi instead of github.com/samfoo/ansi

I wonder if there is any particular reason to build with github.com/samfoo/ansi, which is a (less maintained) fork of github.com/mgutz/ansi?

I noticed recentrly when packaging this library for debian, which already has github.com/mgutz/ansi in its archives. I added a patch for cli-utils to use that instead which builds/works fine.

Could do PR if you agree

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.