sminez / ad

an adaptable text editor
https://crates.io/crates/ad-editor
MIT License
264 stars 10 forks source link

Async command execution #53

Open leahneukirchen opened 3 days ago

leahneukirchen commented 3 days ago

Please describe the change / addition you'd like to see made

It would be very nice if ! created the buffer immediately and started streaming the output to the buffer (e.g. for a long cargo build run.)

There should be a way to interrupt the process execution.

Is this a feature you have seen in other text editors?

Emacs: M-x shell-command cargo build & Acme: Right-mouse-drag command to execute it

sminez commented 3 days ago

I agree, this should very much be how ! works :slightly_smiling_face:

Is it possible to interrupt process execution in this way in acme do you know? When I try running ping google.com for example it will stream the output to a +Errors buffer but closing that buffer results in it immediately being reopened as more output comes in. The only way I can find to kill ping in this case is to pkill it :confused:

leahneukirchen commented 3 days ago

In acme, you can swipe "Kill ping". A buffer-specific keyword would probably be nicer.

sminez commented 3 days ago

Ah cool thanks!

From acme(1):

Kill Send a kill note to acme-initiated commands named as arguments.

https://github.com/9fans/plan9port/blob/61e362add9e1485bec1ab8261d729016850ec270/src/cmd/acme/exec.c#L1240 looks like its where this is handled inside of acme.

I'm not sure I understand what you mean by a "buffer-specific keyword" here. Are you just meaning something less generic than "Kill"?

rakoo commented 3 days ago

Also note that in Acme when you run a command its name is added to the global tag so you can find it easily