Artificial intelligent assistant

Displaying time elapsed since the last change of the content of a pane? Are there any tmux plugins/snippets that display the time elapsed since the last moment the screen (or the content of each pane) changed? It would be particularly helpful for monitoring streams of logs (e.g. via tailf). Thank you.

Use the control mode (`tmux -C`) and parse the output.

Quick and dirty script, a proof of concept:


#!/bin/bash

pane="$1"
trap 'SECONDS=0; dte="$(date)"' USR1

unset TMUX
kill -s USR1 "$$"
tmux -C attach | while read -r a p z; do
[ "$p" = "$pane" ] && kill -s USR1 "$$"
done &

while sleep 1; do printf '\r%-12d %s ' "$SECONDS" "$dte"; done


Usage: `./scriptname %N` where `%N` is the ID of the pane you want to monitor (e.g. `%0`; usually you can get it with `echo "$TMUX_PANE"`). Monitoring the pane where the script runs is possible but makes little sense.

Tested with `tail -f /var/log/syslog` in the monitored pane and `logger` elsewhere.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7d584a11616324258a342f17712b82be