Open danhab99 opened 3 years ago
Looks somewhat similar to #96
Expected behavior Programs are rerun in accordance to its
cmdline
Would you mind showing the original cmdline of these processes? You can find this by running the following command:
hexdump -C /proc/$(xprop _NET_WM_PID | cut -d ' ' -f3)/cmdline
Then click on one of the urxvt windows, and paste the output here.
All 3 of these outputs are from different tiles. Is this a urxvt issue?
00000000 75 72 78 76 74 00 |urxvt.|
00000006
00000000 75 72 78 76 74 00 |urxvt.|
00000006
00000000 75 72 78 76 74 00 |urxvt.|
00000006
Uh sorry should've asked before but can you also show the output of ls -l /proc/$(xprop _NET_WM_PID | cut -d ' ' -f3)/cwd
Oh I also forgot to ask, have you added the urxvt window class as a terminal in the i3-resurrect config? See https://github.com/JonnyHaystack/i3-resurrect#terminals
Been a while since I've been deep in the code or changed my config so I totally forgot this was a thing.. The terminal emulator's cwd doesn't change, but the shell's cwd does. So you need to add it to that list in the config so that i3-resurrect knows to look at the shell subprocess for the cwd instead of the terminal emulator process.
@JonnyHaystack JonnyHaystack
Uh sorry should've asked before but can you also show the output of
ls -l /proc/$(xprop _NET_WM_PID | cut -d ' ' -f3)/cwd
lrwxrwxrwx 1 dan dan 0 Sep 8 16:34 /proc/422021/cwd -> /home/dan
Did you check that you have done according to my last comment and added it as a terminal? That should fix any problem with working directory being restored. Also I'm not really understanding the problem. Programs running inside your shell aren't normally going to be restored, that's not how it works. If you manually launched the terminal emulator passing in a command to execute directly e.g. if I ran something like alacritty -e tmux a
from rofi or from another shell, that would create an alacritty window that launches tmux and attaches to my last session. i3-resurrect can save and restore this no problem because the full command line was passed in from the start, so it's saved in the process cmdline. However, if you start a terminal/shell and later launch another program inside it, e.g. vim, that would not be saved to the cmdline of the shell or terminal emulator so i3-resurrect has no way of knowing to restore it. It's not feasible to look at every subprocess of every subprocess and figure out how to restore everything for arbitrary programs, especially with multi threaded programs etc.
Your suggestion solved it for me in kitty. Any reason not to add more terminals to the default list ?
@teto I didn't want to go adding things that I haven't tested, but yeah I should really add more
Describe the bug
I work pretty much completely using CLI programs like vim. My default terminal emulator is Urxvt. i3-resurrect doesn't retain the
cwd
or program that urxvt was running.To Reproduce Steps to reproduce the behavior:
2
"i3-resurrect save -w 2
i3-resurrect restore -w 2
Expected behavior A clear and concise description of what you expected to happen.
Programs are rerun in accordance to its
cmdline
Screenshots
System information (please complete the following information):
i3-resurrect --version
): i3-resurrect, version 1.4.3i3 -v
): i3 version 4.19.1 (2021-02-01) © 2009 Michael Stapelberg and contributorspython -V
): Python 3.9.6Additional context Add any other context about the problem here.
Layout:
Programs:
This is the project I was working on incase you were wondering.