Comments (10)
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:
- cursor is in the example session "foo"
- save the tmux environment
tmux detach
- creating new session with
tmux new -s work
- 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.
Any updates on this?
from tmux-resurrect.
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:
- cursor is in the example session "foo"
- save the tmux environment
- tmux detach
- killall tmux
- tmux
- 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.
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
cd
ing to some directory and startingvim
- 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.
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.
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.
Hey @bruno- , naming the session solved my problems!!! Thank you.
from tmux-resurrect.
Great!
from tmux-resurrect.
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.
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)
- resurrect files not saving expected data
- Save env variables as well
- Restoring non-existing directories
- Save problems
- Tests failing on clean checkout from master. HOT 1
- Description in document save_dir.md is not complete
- Problem recreate windows
- How to start tmux server with resurrect
- resurrect creates minimal sized horizontal splits
- Resurrect not saving the tmux session as intended HOT 2
- C-b C-r to restore session will end up with [exited] from tmux client on iSH(iOS alpinelinux)
- Login shell not invoked for zsh
- [Question] Create new sessions/windows/layouts using a file - supported?
- [BUG] saving with nvim opens the incorrect files if you have spaces in filenames
- How to upgrade from 3.0 and keep saved sessions ?
- [Bug] Restoring sessions is adding a new empty prompts everytime
- [BUG] Hooks pre-restore-all and post-restore-all don't work correctly with tmux v3.4 HOT 1
- plugin not saving correct command
- automatically restore HOT 1
- Does not save, does not restore, returned 127
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmux-resurrect.