Skip to content
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

nix-instantiate output toys with neomake output parsing #37114

Closed
teto opened this issue Mar 15, 2018 · 1 comment
Closed

nix-instantiate output toys with neomake output parsing #37114

teto opened this issue Mar 15, 2018 · 1 comment

Comments

@teto
Copy link
Member

teto commented Mar 15, 2018

Issue description

I was wondering why neomake's nix maker stopped working after updating to nix-shell 2.0. It seems like it can't parse the output of nix-instantiate anymore because of the CSI color characters according to neomake.log

06:21:42 [D      ] [1.1:5:1] cwd: /home/teto/nixpkgs.
06:21:42 [D      ] [-.-:5:1] automake: started jobs: [1].
06:21:42 [D +0.07] [1.1:5:1] stderr: nix_instantiate: ['�[31;1merror:�[0m syntax error, unexpected ''='', expecting '';'', at �[1m/home/teto/nixpkgs/pkgs/top-level/lua-packages.nix�[0m:66:10', ''].
06:21:42 [D      ] [1.1:5:1] exit: nix_instantiate: 1.
06:21:42 [D      ] [1.1:5:1] nix_instantiate: processing 1 lines of output.
06:21:42 [D      ] [1.1:5:1] Creating location list.
06:21:42 [D      ] [1.1:5:1] Processing 1 entries.
06:21:42 [D      ] [1.-:5:1] File-level errors cleaned.
06:21:42 [D      ] [1.1:5:1] Skipped 1 entries without bufnr: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': 'W', 'maker_name': 'nix_instantiate', 'pattern': '', 'text': '�[31;1merror:�[0m syntax error, unexpected ''='', expecting '';'', at �[1m/home/teto/nixpkgs/pkgs/top-level/lua-packages.nix�[0m:66:10'}].
06:21:42 [D      ] [1.1:5:1] Handling location list: executing lwindow.

shouldn't nix-instantiate doesn't try to print colors when not on a tty ?
Is there a flag to disable the color (couldn't find in man).

Steps to reproduce

Install neomake on vim/neovim (https://github.com/neomake/neomake), then add an error into a nix file and save it. Neomake doesn't show the error as it did.

@teto
Copy link
Member Author

teto commented Mar 19, 2018

Thanks for fixing this. I noticed the same behavior when doing nix search toto | less with nix2_.0pre5968_ac6c0b773 (aka characters appear in less output, for now I aliased less=less -R)

edolstra added a commit to NixOS/nix that referenced this issue Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant