tmux-continuum icon indicating copy to clipboard operation
tmux-continuum copied to clipboard

Support multi-user environments

Open gerases opened this issue 6 years ago • 5 comments

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.

gerases avatar Apr 29 '18 02:04 gerases

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.

gerases avatar May 02 '18 01:05 gerases

Hi @bruno- , I took your advice and changed the code as you suggested.

gerases avatar Jun 22 '18 17:06 gerases

Can this change be merged? It's critical in a multi-user environment.

TheLocehiliosan avatar Jun 22 '18 18:06 TheLocehiliosan

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 avatar Oct 25 '22 13:10 cgr71ii

@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.

bruno- avatar Oct 25 '22 14:10 bruno-