Giter VIP home page Giter VIP logo

Comments (10)

bruno- avatar bruno- commented on August 10, 2024

Hi, thanks for taking the time to report the issue and include all the details.

I'm curious about the "workflow" you described above, I'll repeat it here just for clarity:

  1. cursor is in the example session "foo"
  2. save the tmux environment
  3. tmux detach
  4. creating new session with tmux new -s work
  5. restore the sessions

I don't think there's the benefit of saving and restoring tmux environment in this case, since you never actually quit/kill tmux.
You can verify this by executing tmux attach -t foo after detaching tmux (after step 3). You'll find you're in the session "foo" and everything is preserved.

Here's what I guess is happening when you execute restoring in step 5 above:

  • since tmux was never actually killed, all the saved sessions and windows still exist
  • tmux-resurrect will just switch to the exact "place" where save was executed. In the example above that is session "foo".
  • since session "foo" and windows within it were never killed, you'll see some command output in them. This is normal.

Could this be the case?

Here is the scenario tmux-resurrect was made for:

  • work in tmux as usual
  • save tmux env
  • quit tmux with tmux kill-server (this makes all the difference)
  • start new tmux with just tmux
  • restore tmux env
  • there should be no output in the panes now

Does the above help?
If the weird behavior still happens, can you please attach the content of the file ~/.tmux/resurrect/last?

from tmux-resurrect.

bruno- avatar bruno- commented on August 10, 2024

Any updates on this?

from tmux-resurrect.

lfv89 avatar lfv89 commented on August 10, 2024

Sorry, I forgot to tell you. After a tmux detach I send a killall tmux, and this weird behaviour persist. So those are the steps:

  1. cursor is in the example session "foo"
  2. save the tmux environment
  3. tmux detach
  4. killall tmux
  5. tmux
  6. restore the tmux environment

After that, everything works fine, except for the first panel of the first window. In this specific panel nothing is restored, not even the dir.

pane 0 1 :BAR 1 :* 1 :/foo/bar/viagem 1 bash :
pane 0 1 :BAR 1 :* 2 :/foo/bar/ets 0 bash :
pane 0 2 :DOTFILES 0 :- 1 :/foo/bar/Dotfiles 1 bash :
window 0 1 1 :* 6316,156x45,0,0{78x45,0,0,0,77x45,79,0,1}
window 0 2 0 :- c2bf,156x45,0,0,2
state 0 0

Let me know if you need anything else.

from tmux-resurrect.

bruno- avatar bruno- commented on August 10, 2024

Ah okay, this makes more sense now!

There is a reason why the first pane of the first window is not restored: it's because it exists at the time you restore tmux environment - and tmux-restore will not try to override it.

To better explain this, consider this scenario:

  • a user follows all the steps you outlined above (1-5)
  • but after starting tmux (step 5) a user does some work in the first pane of the first window. Example work might be cding to some directory and starting vim
  • and now, a user decides to restore tmux environment (you listed this as step 6).

Now, what should resurrect do? Kill the already running vim program in the first pane of the first window? This might seem forceful and invasive.
I think the sensible decision in this case is to do nothing.

The "strategy" of doing nothing is also applied in the case when pane only exists (no matter if it has the program running in it or not).

Does this clarify things?

from tmux-resurrect.

pmalek avatar pmalek commented on August 10, 2024

I have experienced the same situation but the panes are being restored properly but the name of the first window is not being restored (it is stored properly in the saved sessions in ~/.tmux/resurrect though)

from tmux-resurrect.

bruno- avatar bruno- commented on August 10, 2024

Hi guys,
the I got a couple more "first window issues" reported so I created a wiki page that explains what is going on https://github.com/tmux-plugins/tmux-resurrect/wiki/Help:-issues-with-the-first-window

Can you please check that out and tell me if it helps? Feedback is appreciated.

from tmux-resurrect.

lfv89 avatar lfv89 commented on August 10, 2024

Hey @bruno- , naming the session solved my problems!!! Thank you.

from tmux-resurrect.

bruno- avatar bruno- commented on August 10, 2024

Great!

from tmux-resurrect.

catdadcode avatar catdadcode commented on August 10, 2024

Is there a way to start tmux and run resurrect-restore without starting a new session? I constantly forget to rename my session and then get frustrated when the first pane is irretrievable. If I could start tmux and issue the restore command rather than the default new-session command that would avoid the whole issue of the pane/window having already existed at the time of restore.

Other than this issue I'm really loving this plugin. What about an option to blow away the existing session and just restore the old one? 99% of the time when I try to restore a session I'd rather have it completely restored than have my first window preserved.

from tmux-resurrect.

bruno- avatar bruno- commented on August 10, 2024

Hmm.. I'm not sure if that would be possible. But anyway, I think there's a workaround when you forget to rename the first session.

So, you just started tmux, you're in a session named (by default) 0 with 1 window. You want to do the restore now, but that first window won't be restored. So get around the issue, you can *now* rename the default session 0 to, let's say foobar and do the restore. Session 0 will be created from scratch including the first window.

Let me know if that helps.

What about an option to blow away the existing session and just restore the old one?

Yea, I should probably enable this somehow, as more people is having issues with this. I'll let you know here when it's done.

from tmux-resurrect.

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.