fix(grid): fix DL/IL being ineffective without scrolling region #3382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In the current
main
branch of Zellij, the standard control functionsDL
(\e[%dM
) andIL
(\e[%dL
) are no-op until any other control function directly or indirectly sets the scrolling region.Problem
ED
(\e[...J
) orDECSTBM
(\e[...r
). To make sure, you could use a simple shell such as Bash or Dash].seq
command should be removed by\e[10M
(delete 10 lines). Then,Hello, world!
is printed.main
branch: Nothing happens with\e[10M
. The output of theseq
command remains in the terminal screen, and the messageHello, world!
is printed over the output of theseq
command.Those control functions
DL
andIL
defined by the ANSI standard (ANSI X 3.64 and corresponding ECMA-48) should operate on the entire viewport if the scrolling region is not defined. In the first place, the ANSI standard doesn't define the scroll region, so they should work even without specifying the scrolling regions (DECSTBM
andDECSLRM
).The problem disappears when any other terminal application sends another standard control function
ED(2)
(\e[2J
) because this control function is designed to set the scroll region to the entire viewport.zellij/zellij-server/src/panes/grid.rs
Lines 2491 to 2493 in c72f3a7
The control function
IL
has the same issue. This PR fixesDL
andIL
so that they operate on the entire viewport by setting the scroll region to the entire viewport (in a similar manner asED(2)
).For the present behavior in the
main
branch, I suspect commitcd5ddd1
, but I haven't tested it and haven't carefully looked at the change either.This fixes the issue originally reported at akinomyoga/ble.sh#450.
Remarks
This is unrelated to the present fix, but with the current implementation of
ED
, the scroll region set byDECSTBM
is lost when the terminal application sendsED(2)
(\e[2J
). Is this intended?