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

Show stderr when :sh command fails #2700

Closed
n0s4 opened this issue Jun 7, 2022 · 2 comments
Closed

Show stderr when :sh command fails #2700

n0s4 opened this issue Jun 7, 2022 · 2 comments
Labels
C-enhancement Category: Improvements

Comments

@n0s4
Copy link
Contributor

n0s4 commented Jun 7, 2022

If I try to, say, cargo run in helix and the command fails I am not given any description why. Why can't helix show the stderr output in the same way as it shows stdout when the command succeeds?

Could we also make it possible to show stderr when the command does not fail? cargo check for instance prints its output to stderr so is not accessible from inside Helix.

@n0s4 n0s4 added the C-enhancement Category: Improvements label Jun 7, 2022
@the-mikedavis
Copy link
Member

It looks like the stderr is not totally discarded, just kicked out to the log file:

if !output.stderr.is_empty() {
log::error!("Shell error: {}", String::from_utf8_lossy(&output.stderr));
}
. I'm not sure there's a good way to display it in the UI currently: it could be put in-line with the stdout input styled red but that wouldn't be a trivial change looking at how run_shell_command and shell_impl are implemented.

In general I think a dedicated terminal would fit this workflow better, either through tmux/screen/zellij or #1976. There are some cases where you will want to see the full error message of cargo check for some extended time, or run a long-running command async that fit better in a terminal pane than in a popup within helix.

@n0s4 n0s4 closed this as completed Jun 15, 2022
@r-odriguez
Copy link

A horizontal split with a scratch buffer similar to what log does could be a good approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

3 participants