emacs/var/elfeed/db/data/92/92eff6dfbcddbcda116b4e141aa5d517ae3a273a
2022-01-03 12:49:32 -06:00

9 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>Nacho Barrientos has an interesting video in which he explains <a href="https://www.youtube.com/watch?v=wbG-a8DIIuY">how to run an eshell process in the background</a>. Barrientos illustrates this with the <code>sleep</code> command. Normally, if you enter</p>
<div class="org-src-container">
<pre class="src src-shell">sleep 4
</pre>
</div>
<p>in Eshell, Emacs will hang until <code>sleep</code> completes in 4 seconds. Barrientos idea is to use the Emacs <code>compile</code> mechanism to run the command in the background. The output is redirected to the <code>*compile*</code> buffer and the Eshell prompt returns immediately.</p>
<p>Thats a nice way of starting a long running process from Eshell and being able to continue working in Emacs. He also has a way of burying the <code>*compile*</code> buffer and getting a message when the process completes.</p>
<p>Theres not a lot of code needed to implement this. You can see the relevant function in <a href="https://github.com/nbarrientos/dotfiles/blob/c79ef0f9908844346a8506129dedbb94f3b6b678/.emacs.d/init.el#L767">Barrientos init.el</a>. If you use Eshell regularly and sometimes want to invoke long-running processes, its worth taking a look at this video. The run time is only 4 minutes, 21 seconds so it should be easy to fit it in</p>
<p><b>UPDATE</b> <span class="timestamp-wrapper"><span class="timestamp">[2021-12-31 Fri 13:03]</span></span>: In the comments, Niklas Eklund writes that he has a package that does the same sort of thing. You can read his post about it <a href="https://niklaseklund.gitlab.io/blog/posts/dtache_eshell/">here</a>. Elkunds package works with any shell so it may be a worthwhile addition to your configuration.</p>