Here is what Xterm 388 and VTE 0.76 do for some of the escape sequences.
DEC STD 070 might say otherwise, and reportedly the actual behavior of DEC hardware is yet again different.
See https://gitlab.gnome.org/GNOME/vte/-/issues/2526 for details.

The black area inside (excluding) the stripes is the terminal area.
The blue rectangle is the scrolling region.
The words written on the canvas show what happens if the cursor is at that location when the said escape sequence arrives.
Some escape sequences are 90° or 180° rotations of each other, they share a common picture, it should be obvious to rotate.


  [30;106m CUU (similarly: CUD, CUB ~ BS ~ CR, CUF ~ printing a letter) [m

CUU, CUD, CUB, CUF: The picture shows the behavior written in DEC STD 070 (pp. 5-41..5-48) and implemented in Xterm and VTE.
Reportedly DEC terminals behave differently: If the cursor is outside the scroll area then it doesn't stop at the margin.

CR, BS: The picture shows the behavior implemented in Xterm and VTE.
DEC STD 070 (pp. 5-58, 5-63) says that if the cursor is outside the scroll area then it doesn't stop at the margin.
Reportedly DEC's actual behavior matches this.

[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m
[97;40m🮙🮙[53m▏                        s  t  o  p  s     h  e  r  e  ,     n  o     s  c  r  o  l  l  i  n  g                        ▕[55m🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                    ↑ moves up                          🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙[53m▏                        s  t [44m o  p  s     h  e  r  e  ,     n  o     s  c  r  o  l  l  i [40m n  g                        ▕[55m🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m           ↑ moves up         🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙    ↑ moves up                [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                      ↑ moves up            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                          ↑ moves up                                                                                    🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m


  [30;106m RI (similarly: IND ~ LF, DECFI, DECBI) [m

The picture shows the behavior implemented in Xterm and VTE.
DEC STD 070 (pp. 5-34..5-40) says that even if the cursor hits the margin outside the scroll area then the scroll area is
scrolled. Reportedly DEC terminals move the cursor in this case.

[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m
[97;40m🮙🮙[53m▏                        s  t  o  p  s     h  e  r  e  ,     n  o     s  c  r  o  l  l  i  n  g                        ▕[55m🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                    ↑ moves up                          🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙[53m▏  stops here, no scrolling  ▕[44m▏          stops here and scrolls the blue region          ▕[40m▏  stops here, no scrolling  ▕[55m🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m           ↑ moves up         🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙    ↑ moves up                [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                      ↑ moves up            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                          ↑ moves up                                                                                    🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m


  [30;106m SU, SD [m

The picture shows the behavior implemented in Xterm and VTE.
According to DEC STD 070 (pp. 5-91..5-92) they move the page relative to the window, an entirely different concept unrelated
to margins. See also https://gitlab.gnome.org/GNOME/vte/-/issues/2663#note_1860599.

[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                  scrolls                                                                                               🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                            the                                                                                         🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m        blue                                                [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                  region,                                   [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                            no                              [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                      matter                [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                where       [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                            [40m                              🮙🮙[m
[97;40m🮙🮙                              [44m                                                          th[40me                             🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                  cursor                🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                            is          🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m


  [30;106m IL, DL, DECIC, DECDC, SL, SR [m

IL, DL, DECIC, DECDC: The picture shows what's written in DEC STD 070 (pp. 5-146..5-151) and implemented in Xterm and VTE.
Reportedly the behavior of DEC terminals also matches.

SL, SR aren't available in DEC, they could be an Xterm extension.

[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                 does nothing                           🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                              ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁                              🮙🮙[m
[97;40m🮙🮙                             ▕[44m                                                            [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m    scrolls the blue region, further restricted to:         [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m     - IL, DL: cursor's row and below                       [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m     - DECIC, DECDC: cursor's column and its right          [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m     - SL, SR: no further restriction                       [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m                                                            [40m▏        does nothing         🮙🮙[m
[97;40m🮙🮙                             ▕[44m       ·<-------------------------------------------------->[40m▏                             🮙🮙[m
[97;40m🮙🮙   does nothing              ▕[44m       ^                   DECIC, DECDC                     [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m       |                                                    [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m       | IL, DL                                             [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m       |                                                    [40m▏                             🮙🮙[m
[97;40m🮙🮙                             ▕[44m       v                                                    [40m▏                             🮙🮙[m
[97;40m🮙🮙                              ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔                              🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                        does nothing                                                                                    🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙                                                                                                                        🮙🮙[m
[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m


  [30;106m ICH, DCH [m

The picture shows the behavior written in DEC STD 070 (pp. 5-142..5-145) and implemented in Xterm and VTE.
Reportedly DEC hardware behave differently if the cursor is outside the top/bottom margins, they shift to/from the right
edge of the screen rather than the right margin.

[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m
[97;40m🮙🮙                             ▕                                                            ▏                             🮙🮙[m
[97;40m🮙🮙                             ▕                                                            ▏                             🮙🮙[m
[97;40m🮙🮙                             ▕    scrolls                                           ·<--->▏                             🮙🮙[m
[97;40m🮙🮙                             ▕     the                                                    ▏                             🮙🮙[m
[97;40m🮙🮙                             ▕      cursor's                                              ▏        d                    🮙🮙[m
[97;40m🮙🮙                             ▕       row                                                  ▏         o                   🮙🮙[m
[97;40m🮙🮙                             ▕[44m        between                                             [40m▏          e                  🮙🮙[m
[97;40m🮙🮙                             ▕[44m         the                                                [40m▏           s                 🮙🮙[m
[97;40m🮙🮙         d                   ▕[44m          cursor                                            [40m▏                             🮙🮙[m
[97;40m🮙🮙          o                  ▕[44m           and                                              [40m▏             n               🮙🮙[m
[97;40m🮙🮙           e                 ▕[44m            the                        ·<------------------>[40m▏              o              🮙🮙[m
[97;40m🮙🮙            s                ▕[44m             right                                          [40m▏               t             🮙🮙[m
[97;40m🮙🮙                             ▕[44m              margin                                        [40m▏                h            🮙🮙[m
[97;40m🮙🮙              n              ▕[44m               (the                                         [40m▏                 i           🮙🮙[m
[97;40m🮙🮙               o             ▕[44m                top                                         [40m▏                  n          🮙🮙[m
[97;40m🮙🮙                t            ▕[44m                 and                                        [40m▏                   g         🮙🮙[m
[97;40m🮙🮙                 h           ▕[44m                  bottom                                    [40m▏                             🮙🮙[m
[97;40m🮙🮙                  i          ▕[44m                   margins                                  [40m▏                             🮙🮙[m
[97;40m🮙🮙                   n         ▕                    don't                                   ▏                             🮙🮙[m
[97;40m🮙🮙                    g        ▕                     matter)                                ▏                             🮙🮙[m
[97;40m🮙🮙                             ▕                                                            ▏                             🮙🮙[m
[97;40m🮙🮙                             ▕       ·<-------------------------------------------------->▏                             🮙🮙[m
[97;40m🮙🮙                             ▕                                                            ▏                             🮙🮙[m
[97;40m🮙🮙                             ▕                                                            ▏                             🮙🮙[m
[97;40m🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙🮙[m

