ephemeral_close.go RawHistoryFolder

1package daemon
2
3import (
4	"errors"
5
6	"github.com/bnema/vev/internal/protocol"
7)
8
9// reapAbandonedEphemeral removes an ephemeral session whose last attachment
10// ended definitively (a closed client process, or an expired park or
11// suspension) when ephemeral.close-on-exit is on. A user detach or picker
12// switch never calls it: those keep the session for later reattach.
13//
14// The emptiness and ephemeral checks run under the architecture locks at
15// snapshot and publication, so any live, suspended, parked, or parking
16// attachment, or a concurrent rename into a named session, keeps it.
17// Callers must not hold daemon, session, or attachment locks.
18func (d *Daemon) reapAbandonedEphemeral(sess *session) {
19	if sess == nil || !d.currentEphemeralConfig().CloseOnExit {
20		return
21	}
22	err := d.killEphemeralSessionIfEmpty(sess, protocol.ReasonSessionKilled)
23	switch {
24	case errors.Is(err, errSessionKillParticipantsChanged):
25		// An attachment or rename won the race: the session stays by design.
26		d.log.Debug("ephemeral close-on-exit skipped", "session", sess.nameSnapshot())
27	case err != nil:
28		d.log.Warn("ephemeral close-on-exit failed", "err", err, "session", sess.nameSnapshot())
29	case !d.sessionRegistered(sess):
30		d.log.Info("ephemeral session gone after last attachment ended", "session", sess.nameSnapshot())
31	}
32}
33
34// sessionHasPendingResumeLocked reports whether sess still retains a parked or
35// in-flight parking attachment that a reconnecting client may resume. Caller
36// holds d.mu.
37func (d *Daemon) sessionHasPendingResumeLocked(sess *session) bool {
38	return d.resume.retainsSession(sess)
39}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close