Andrew Haust
Andrew Haust

Reputation: 356

Make tmux only monitor activity on status return

Is there a way to make tmux only show an activity alert once a process has returned?

Assuming you have activity monitoring activated, the way it works by default is to alert you whenever anything in the window changes. This is essentially useless (and incredibly annoying) if you are running any long-running process that spits out progress or any other kind of output along the way.

Suggesting that I run these commands with --quiet or the like is NOT what I'm looking for. In a lot of cases, I want to be able to check up on them (not to mention, know that they haven't crashed).

I'm not too hopeful here since I've read through the docs and the options for activity monitoring are pretty slim. Does anyone know some other hack to make this work??

Upvotes: 3

Views: 1449

Answers (1)

pengeorge
pengeorge

Reputation: 56

I'am also trying to do the same thing. The options monitor-content and monitor-silence may be helpful.

  1. If a process keeps printing something on the window, use monitor-silence to monitor long silence.

setw -g monitor-silence INTERVAL

A window would be highlighted if it has been silent for INTERVAL seconds.

  1. If a process never prints anything, or prints only several times in a very long period, use monitor-content to monitor a specified content. For example

setw -g monitor-content 'Process exited'

Then run your command in this way

clear; YOUR_COMMAND; echo 'Process exited'

Not a perfect solution, but works for me in most cases.

Upvotes: 4

Related Questions