detached 532e4e5

fix(vt): home scroll margins inside origin mode

commit
532e4e5de12514ec512800909910b6f04eae351b
author
brice · · 2026-07-09 14:23 UTC
parent
b34df7b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +20 -1
M pkg/vt/screen.go +1 -1
@@ -1135,7 +1135,7 @@ func (s *Screen) setScrollRegion(parts []int) {
11351135 s.resetScrollRegion()
11361136 }
11371137 }
1138- s.Row, s.Col = 0, 0
1138+ s.homeCursor()
11391139 }
11401140
11411141 func (s *Screen) resetScrollRegion() {
@@ -1135,7 +1135,7 @@ func (s *Screen) setScrollRegion(parts []int) {
1135 s.resetScrollRegion()1135 s.resetScrollRegion()
1136 }1136 }
1137 }1137 }
1138- s.Row, s.Col = 0, 01138+ s.homeCursor()
1139 }1139 }
1140 1140
1141 func (s *Screen) resetScrollRegion() {1141 func (s *Screen) resetScrollRegion() {
M pkg/vt/screen_test.go +19 -0
@@ -1316,6 +1316,25 @@ func TestCSIEditingSequences(t *testing.T) {
13161316 }
13171317 },
13181318 },
1319+ {
1320+ name: "DECOM already set homes DECSTBM to scroll region",
1321+ run: func(t *testing.T) {
1322+ s := NewScreen(6, 5)
1323+ s.Write([]byte("\x1b[?6h\x1b[2;4r"))
1324+ if s.Row != 1 || s.Col != 0 {
1325+ t.Fatalf("DECSTBM cursor with DECOM set = (%d,%d), want (1,0)", s.Row, s.Col)
1326+ }
1327+
1328+ s.Write([]byte("\x1b[2;3H"))
1329+ if s.Row != 2 || s.Col != 2 {
1330+ t.Fatalf("DECOM addressed cursor after DECSTBM = (%d,%d), want (2,2)", s.Row, s.Col)
1331+ }
1332+ s.Write([]byte("\x1b[99;1H"))
1333+ if s.Row != 3 || s.Col != 0 {
1334+ t.Fatalf("DECOM clamped cursor after DECSTBM = (%d,%d), want (3,0)", s.Row, s.Col)
1335+ }
1336+ },
1337+ },
13191338 {
13201339 name: "DECOM reset homes and restores full-frame addressing",
13211340 run: func(t *testing.T) {
@@ -1316,6 +1316,25 @@ func TestCSIEditingSequences(t *testing.T) {
1316 }1316 }
1317 },1317 },
1318 },1318 },
1319+ {
1320+ name: "DECOM already set homes DECSTBM to scroll region",
1321+ run: func(t *testing.T) {
1322+ s := NewScreen(6, 5)
1323+ s.Write([]byte("\x1b[?6h\x1b[2;4r"))
1324+ if s.Row != 1 || s.Col != 0 {
1325+ t.Fatalf("DECSTBM cursor with DECOM set = (%d,%d), want (1,0)", s.Row, s.Col)
1326+ }
1327+
1328+ s.Write([]byte("\x1b[2;3H"))
1329+ if s.Row != 2 || s.Col != 2 {
1330+ t.Fatalf("DECOM addressed cursor after DECSTBM = (%d,%d), want (2,2)", s.Row, s.Col)
1331+ }
1332+ s.Write([]byte("\x1b[99;1H"))
1333+ if s.Row != 3 || s.Col != 0 {
1334+ t.Fatalf("DECOM clamped cursor after DECSTBM = (%d,%d), want (3,0)", s.Row, s.Col)
1335+ }
1336+ },
1337+ },
1319 {1338 {
1320 name: "DECOM reset homes and restores full-frame addressing",1339 name: "DECOM reset homes and restores full-frame addressing",
1321 run: func(t *testing.T) {1340 run: func(t *testing.T) {

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