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

Print stderr when running a command just like vim does #435

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

pmnoxx
Copy link
Contributor

@pmnoxx pmnoxx commented Jan 2, 2022

I noticed that whenever try to run a local command: ":! something" only stdout gets printed.

In vim/nvim both stderr and stdout get printed. We can fix this with this PR.

TODO:

  • Test that the stderr is printed
  • Test that colors are properly stripped from the output.

@pmnoxx
Copy link
Contributor Author

pmnoxx commented Jan 2, 2022

I checked, now I get a nice readable output after colors get stripped:

:!pg a %

2022-01-02T16:09:29.671516Z  INFO play_ground::imports_analyzer: crate::cmd -> 1
2022-01-02T16:09:29.671530Z  INFO play_ground::imports_analyzer: crate::custom_layer::CustomLayer -> 1
2022-01-02T16:09:29.671534Z  INFO play_ground::imports_analyzer: anyhow::Error -> 3
2022-01-02T16:09:29.671537Z  INFO play_ground::imports_analyzer: reqwest::header -> 4
2022-01-02T16:09:29.671540Z  INFO play_ground::imports_analyzer: std::env -> 3
2022-01-02T16:09:29.671543Z  INFO play_ground::imports_analyzer: std::fs -> 1
2022-01-02T16:09:29.671545Z  INFO play_ground::imports_analyzer: std::io -> 4
2022-01-02T16:09:29.671547Z  INFO play_ground::imports_analyzer: std::path -> 1
2022-01-02T16:09:29.671550Z  INFO play_ground::imports_analyzer: std::process -> 1
2022-01-02T16:09:29.671553Z  INFO play_ground::imports_analyzer: tracing::Level -> 3 / 4 indirect=1
2022-01-02T16:09:29.671556Z ERROR play_ground::imports_analyzer: x1=3 x2=4

@AlexPl292
Copy link
Member

Great, thank you for the contribution!

@AlexPl292 AlexPl292 merged commit 9b4825d into JetBrains:master Jan 21, 2022
@pmnoxx pmnoxx deleted the piotr-print-stderr branch January 21, 2022 15:29
@AlexPl292
Copy link
Member

Hi @pmnoxx ! Could you please take a look at this discussion so we can use your change under the new MIT license? Thank you!

#542

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

Successfully merging this pull request may close these issues.

2 participants