summaryrefslogtreecommitdiff
path: root/packages/blog/content/posts/nohup.md
blob: 64f7983a0f9e5726ffce5c4ba0463f9af090bfab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
title: "Spawning background processes"
date: "2024-11-17"
---

Working in a terminal,
I often pair my editor with a background process watching files.
Before reaching for terminal multiplexers,
see if you can get away with simple tty job control.
Spawn the background process,
still attached to the terminal instance:

```
program args &
```

Also redirect its output to a file,
for when the process writes to the tty from the background:

```
nohup program args &
```

Extra reading:

- <https://jvns.ca/blog/2024/07/03/reasons-to-use-job-control/>