Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pallxk opened this issue Aug 9, 2019 · 0 comments · Fixed by #857
Closed

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

pallxk opened this issue Aug 9, 2019 · 0 comments · Fixed by #857
Labels
bug Something isn't working

Comments

@pallxk
Copy link

pallxk commented Aug 9, 2019

  • 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
@pallxk pallxk added the bug Something isn't working label Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants