tmux-continuum
tmux-continuum copied to clipboard
Support multi-user environments
When counting the number of running tmux processes, count only those that belong to the current user.
tmux a
shows as a separate process (must be the client process) and
thus needs to be excluded from the calculation as well. The previous
exclusion of tmux source
was also incorporated.
The ps -u needs to be tested but i agree. The E is to be explicit about using regular expressions. Do you know of a reason not to use it?
On May 1, 2018, at 9:18 AM, Bruno Sutic [email protected] wrote:
@bruno- commented on this pull request.
In scripts/helpers.sh:
@@ -23,10 +23,14 @@ current_tmux_server_pid() { }
all_tmux_processes() {
ignores
tmux source-file .tmux.conf
command used to reload tmux.conf- ps -Ao "command pid" |
\grep "^tmux" |
\grep -v "^tmux source"
finds all tmux processes for the current user ignoring the following:
1)
tmux source-file .tmux.conf
(used to reload tmux.conf)2)
tmux a
(which shows an additional process)- ps -Ao "command pid uid" |\
- grep $UID |\
- grep -E '^tmux' |
Why add -E flag?— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hi @bruno- , I took your advice and changed the code as you suggested.
Can this change be merged? It's critical in a multi-user environment.
Hi! Why this PR was not accepted? Is not finished? It'd be very useful to solve https://github.com/tmux-plugins/tmux-continuum/issues/48 since I think it's a common use case to share resources among co-workers, where multiple tmux sessions might be alive for different users...
@cgr71ii this PR adds features that are outside the original scope. Also, some comments/questions were not addressed. Since I personally don't need this feature I didn't want to push it.
If someone can make a clean, minimal change that addresses this problem I'll review the PR and merge if all is ok.