helix icon indicating copy to clipboard operation
helix copied to clipboard

Adds a run-shell-command-no-output command

Open dariooddenino opened this issue 3 years ago • 4 comments
trafficstars

Hi! This PR adds an additional command to run a shell command ignoring the output.

The command is :run-shell-command-no-output (alias :sh!).

I'm a bit uncertain about the usage of ShellBehavior::Ignore and Append, but I didn't want to use a boolean.

dariooddenino avatar Jul 29 '22 14:07 dariooddenino

Two things:

  • I don't think this is an appropriate use of ! in the alias name. Elsewhere ! always signals "force" behavior like :q!. Here I'm kinda confused by its meaning.
  • This should be async - :run-shell-command-no-output sleep 5 for example blocks the whole editor for a while. Without output I can't think of any reason to block. We should probably not be blocking in :sh either.

the-mikedavis avatar Jul 30 '22 17:07 the-mikedavis

I agree completely! What would a more appropriate name be? :sh-no-output is not that much of a shorter alias. I think the corresponding bash ways to do so don't translate that well to a short name.

dariooddenino avatar Jul 30 '22 17:07 dariooddenino

I think it should be :shush :P

the-mikedavis avatar Jul 30 '22 17:07 the-mikedavis

Looks like this needs a run of cargo fmt ~but otherwise this looks good~ (whoops, forgot about the async point although that might be better served by https://github.com/helix-editor/helix/pull/3029/files)

the-mikedavis avatar Aug 06 '22 15:08 the-mikedavis

Closing because this has gone pretty stale. We would still like to see this but as a flag for sh instead of a new command once we have a command flag parswe

pascalkuthe avatar Apr 08 '24 23:04 pascalkuthe