graphics_capability.go RawHistoryFolder

1package daemon
2
3import (
4	"github.com/bnema/vev/internal/domain"
5)
6
7// sessionHasKittyGraphics reports whether a session currently contains any
8// decoded Kitty scene. It is used only for an attachment-local warning; the
9// renderer still suppresses graphics for attachments that did not declare
10// direct support.
11func sessionHasKittyGraphics(sess *session) bool {
12	if sess == nil {
13		return false
14	}
15	sess.mu.Lock()
16	tabs := append([]*tab(nil), sess.tabs...)
17	sess.mu.Unlock()
18	for _, tb := range tabs {
19		if tb == nil {
20			continue
21		}
22		tb.mu.Lock()
23		panes := make([]*pane, 0, len(tb.panes)+1)
24		for _, p := range tb.panes {
25			panes = append(panes, p)
26		}
27		if tb.floating.pane != nil {
28			panes = append(panes, tb.floating.pane)
29		}
30		tb.mu.Unlock()
31		for _, p := range panes {
32			if p == nil {
33				continue
34			}
35			p.mu.Lock()
36			graphics := p.screen.GraphicsSnapshot()
37			p.mu.Unlock()
38			if graphics != nil && graphics.Usage().Placements != 0 {
39				return true
40			}
41		}
42	}
43	return false
44}
45
46func (d *Daemon) warnUnsupportedGraphics(ac *attachedClient) bool {
47	if d == nil || ac == nil || ac.output == nil || ac.terminalCapabilities.SupportsKittyGraphics() {
48		return false
49	}
50	sess := ac.currentAttachmentSession()
51	if sess == nil || !sessionHasKittyGraphics(sess) || ac.output.graphicsUnsupportedWarned.Swap(true) {
52		return false
53	}
54	return d.publishToast(ac, domain.Notification{
55		Code:      domain.NoticeUser,
56		Severity:  domain.NoticeWarn,
57		Message:   "Kitty graphics are unavailable on this attachment; images are suppressed.",
58		Time:      d.clock.Now(),
59		Count:     1,
60		SessionID: sess.id,
61	})
62}

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