screen-save icon indicating copy to clipboard operation
screen-save copied to clipboard

Add an autoremove in auto start script

Open camlafit opened this issue 1 year ago • 3 comments

Hello

If we enable auto start and auto save script we can have some trouble during a reboot with unnamed screen.

With unnamed screen, a screnrc with pid is saved, on restart this screenrc is loaded but with new pid. Then next auto save will add a new screenrc file. On next reboot will get two screen launched.

I propose to set by default an autoremove when autostart is used. An option could be added to ignore this action ?

could be interesting ?

camlafit avatar Aug 28 '24 12:08 camlafit

Good finding.

I suggest removing all previously saved sessions when saving all sessions. (or better, move them to a folder called "removed").

Another option would be to name the screen session after the first PID.

Removing after Autostart has the disadvantage that no saved sessions exist until the next timer is triggered. If the computer crashes or reboots during this time, all sessions will be lost.

simonwalz avatar Aug 28 '24 18:08 simonwalz

Hello

An another idea could be to rename session file after its restart with new PID. I've any idea if it's possible.

camlafit avatar Aug 29 '24 07:08 camlafit

Hello

I've test a solution to prevent duplicate context. Looks be ok with renaming approach.

camlafit avatar Sep 02 '24 15:09 camlafit