Skip to content

use isatty() before formatting -h text #408

Open
@amckinlay

Description

@amckinlay

Subject of the issue

step -h outputs terminal escape sequences even when standard output is not a TTY device. Programs like vi and less will visually display the formatting characters instead of formatting the text. Terminal escape sequences should be disabled if not outputting to a terminal. step should check isatty() before formatting output text.

Your environment

  • OS - darwin/amd64
  • Version - 0.15.3

Steps to reproduce

step -h | less

Expected behaviour

`step -h | less' does not display formatting characters.

Actual behaviour

step -h | less shows terminal escape sequence characters interleaved with help text.

Additional context

Why is the output of step certificate create -h 331 lines in length? Could help be cut down into a separate -h and --help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions