Commit 8f91842
committed
Notify the view when a full reset replaces the buffer
resetToInitialState() rebuilds the buffer and then calls syncScrollArea()
so the view can recompute its scroll geometry, but that method is an empty
stub. On iOS contentSize/contentOffset are only recomputed by
TerminalView.updateScroller(), and none of its four callers fire on this
path: there is no buffer switch, no scrolled line, no keystroke and no
resize. The scroll view therefore keeps the geometry of a buffer that no
longer exists and renders blank until an unrelated layout pass corrects it.
Quitting a full-screen TUI with Ctrl+C reproduces it: the program emits RIS
while tearing down, and ensureCaretIsVisible() has already run at keypress
time, before the reset.
Notify bufferActivated instead of implementing syncScrollArea() itself:
five of its eight call sites are keypad-mode changes that do not touch the
buffer, and on iOS bufferActivated resets the scroll-follow state, so
routing those through it would pull a user who has scrolled back down to
the bottom.1 parent 3917686 commit 8f91842
3 files changed
Lines changed: 58 additions & 1 deletion
File tree
- Sources/SwiftTerm
- Tests/SwiftTermTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5578 | 5578 | | |
5579 | 5579 | | |
5580 | 5580 | | |
| 5581 | + | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
| 5585 | + | |
| 5586 | + | |
| 5587 | + | |
| 5588 | + | |
5581 | 5589 | | |
5582 | 5590 | | |
5583 | 5591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments