Coder Social home page Coder Social logo

Comments (4)

bruno- avatar bruno- commented on August 16, 2024

thanks for resurrect/continuum, the are really needed functionality for tmux

Thanks, I'm glad you find them useful.

Is there a way to do this per user?

I'm not sure, there might be a way. Frankly, I don't need this feature and I'm not the right candidate to implement it.

Let's see if other users would find this useful (please upvote with 👍). If yea then we'd be looking for someone to implement this.

Just a note: when initially working on the feature of preventing 2 (or more) tmux servers doing autosave it was hard-ish to make it work properly. Adding process ownership to the mix could make this even more complicated.

from tmux-continuum.

szimonek avatar szimonek commented on August 16, 2024

Hi,

We are also using one central access server for several users, where anyone can run tmux, so it was a problem also for us. This can be fixed with a simple and safe change.
Edit .tmux/plugins/tmux-continuum/scripts/helpers.sh scroll to all_tmux_processes function and change it contents from:

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"
}

to:

all_tmux_processes() {
        # ignores `tmux source-file .tmux.conf` command used to reload tmux.conf
        ps -Ao "command user pid" |
                \grep `whoami` |
                \grep "^tmux" |
                \grep -v "^tmux source"
}

This function is used for searching if another tmux instance is running. By default it searches all processess and filters them only to tmux, so it catches all tmux instances started on machine. I have extended filter to match only tmux started by current user. This change is safe because each user has it's own save directory (default $HOME/.tmux/resurrect) and still only first tmux started by a user will save it's contents to this directory.

Feel free to create a pull request and merge this change to tmux-continuum code.

Globally allowing tmux-continuum to save multiple tmux instnaces is much more complicated because this will need multiple tmux-resurrect save directiories (one per tmux instnace), and some logic in tmux-continuum to choose right directory. I also agree with argument that normally running (and saving) multiple tmux instances is not required.

Best regards
Szymon

from tmux-continuum.

bruno- avatar bruno- commented on August 16, 2024

Hi @szimonek thanks for the patch, I think it will do the work!
I applied it locally and will test it today. If all is good I'll push it by tomorrow.

from tmux-continuum.

bruno- avatar bruno- commented on August 16, 2024

Implemented via 1531b37

Sorry for the 3 year wait

from tmux-continuum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.