Skip to content

output of (v2) code-server --version is not script friendly #891

Closed
@pallxk

Description

@pallxk
  • code-server version: 2.preview.2-vsc1.36.1
  • OS Version: Linux 5.2.6-arch1-1-ARCH x86_64

Description

  • code-server --version errors when used with a pipe.
  • code-server --version colors output even in pipe.

I'm doing the following to produce what's got output in v1 of code-server:

code-server --version | head -1 | cut -d' ' -f3

But this actually produces Error: Unexpected SIGPIPE; workaround is 2> /dev/null.
In addition, the output contains ANSI color escape, which is undesirable; check it with:

code-server --version 2> /dev/null | head -1 | cut -d' ' -f3 | hexdump -C

Steps to Reproduce

  1. code-server --version | head -1
  2. code-server --version 2> /dev/null | head -1 | cut -d' ' -f3 | hexdump -C

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions