Closed ghost closed 6 years ago
Hey,
I think your hunch is right. The program should be saved as :htop
, not as :-zsh htop
.
I think this would happen if you are for some reason running zsh
inside another shell as a subprocess? I'm not sure if this line set-option -g default-shell $SHELL
could be related?
Try checking your zsh
shell's parent process is tmux
process.
Thanks for your comment @bruno- :)
I added that line because this wasn't working and thought it could help. After removing that line and checking $$
and $PPID
from a regular terminal and from tmux, this is what I've got:
Before launching tmux:
$ ps -aux | grep $$
# /bin/zsh
$ ps -aux | grep $PPID
# termite
From tmux:
$ ps -aux | grep $$
# -zsh
$ ps -aux | grep $PPID
# tmux
I think it's weird how $$
changes from /bin/zsh
to -zsh
(including the dash, that same dash I'm seeing on the last
files from resurrect) but I'm still clueless :(
I am now starting tmux as a user service and $$
seems to be consistent: /bin/zsh
. However, when I save the session it still has shell and process inverted :/
pane dsiguero 0 :htop 1 :* 0 :/home/dsiguero 0 zsh :/bin/zsh
pane dsiguero 0 :htop 1 :* 1 :/home/dsiguero 1 htop :/bin/zsh
Looks like this is the same issue than https://github.com/tmux-plugins/tmux-resurrect/issues/215. I modified save_command_strategies/ps.sh
to reflect the change from https://github.com/tmux-plugins/tmux-resurrect/pull/216 and it works. The saved sessions now look right (I believe):
pane dsiguero 0 :htop 1 :* 0 :/home/dsiguero 0 zsh :
pane dsiguero 0 :htop 1 :* 1 :/home/dsiguero 1 htop :htop
Thanks for the investigation. It turns out we can use the change proposed in #216 for all operating systems so I just did that via 9dc3f8c639cb8b1d868002a037b7edbf39f3dd12
Can you update the plugin from latest master
and let me know if this fixes the problem for you? If yea, can you please close the issue. Thanks.
Yes, it is working now. Thank you!
Just discovered this amazing plugin and the first thing I must say: it is amazing to be able to save sessions for later, you're all doing a great job :1st_place_medal:. While saving and restoring the layouts was easy, I haven't been able to "resurrect" running programs. Not even talking about custom programs, but the ones that should be "resurrected" by default (ie:
htop
).So I run
tmux
, create a split pane, runhtop
and then save withprefix C-s
.Looking at my
~/.tmux/resurrect/last
I can see the following:As far as I've seen (mostly from other people's
last
files on this repo):htop
should be present).<shell> :<command>
.When manually modifying the
last
file and changing it to something like the following, it re-runs htop successfully, after the session is restored:Other info:
Terminal emulator:
termite
Shell:zsh
tmux -V
: 2.7Any ideas about what might be happening here?
Thank you! :)