Don't resurrect exited terminals on daemon restart
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
44e85b768f
commit
1ee4673d7c
@@ -158,8 +158,10 @@ func serve(cfg *config.Config) error {
|
|||||||
_ = st.Update(func(s *store.State) {
|
_ = st.Update(func(s *store.State) {
|
||||||
s.Terminals = s.Terminals[:0]
|
s.Terminals = s.Terminals[:0]
|
||||||
for _, t := range list {
|
for _, t := range list {
|
||||||
|
if t.Running { // an exited shell must not come back from the dead on restart
|
||||||
s.Terminals = append(s.Terminals, store.Terminal{ID: t.ID, Name: t.Name})
|
s.Terminals = append(s.Terminals, store.Terminal{ID: t.ID, Name: t.Name})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// Re-open the shells that existed before the last restart (fresh processes,
|
// Re-open the shells that existed before the last restart (fresh processes,
|
||||||
|
|||||||
Reference in New Issue
Block a user