Commit bc48eda
Reset _wrapForced when erasing scrollback (#16610)
#15541 changed `AdaptDispatch::_FillRect` which caused it to not affect
the `ROW::_wrapForced` flag anymore. This change in behavior was not
noticeable as `TextBuffer::GetLastNonSpaceCharacter` had a bug where
rows of only whitespace text would always be treated as empty.
This would then affect `AdaptDispatch::_EraseAll` to accidentally
correctly guess the last row with text despite the `_FillRect` change.
#15701 then fixed `GetLastNonSpaceCharacter` indirectly by fixing
`ROW::MeasureRight` which now made the previous change apparent.
`_EraseAll` would now guess the last row of text incorrectly,
because it would find the rows that `_FillRect` cleared but still
had `_wrapForced` set to `true`.
This PR fixes the issue by replacing the `_FillRect` usage to clear
rows with direct calls to `ROW::Reset()`. In the future this could be
extended by also `MEM_DECOMMIT`ing the now unused underlying memory.
Closes #16603
## Validation Steps Performed
* Enter WSL and resize the window to <40 columns
* Execute
```sh
cd /bin
ls -la
printf "\e[3J"
ls -la
printf "\e[3J"
printf "\e[2J"
```
* Only one viewport-height-many lines of whitespace exist between the
current prompt line and the previous scrollback contents ✅
(cherry picked from commit 5f71cf3)
Service-Card-Id: 91707937
Service-Version: 1.191 parent 29895e1 commit bc48eda
File tree
4 files changed
+51
-23
lines changed- src
- buffer/out
- host/ut_host
- terminal/adapter
4 files changed
+51
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
161 | | - | |
162 | | - | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | | - | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
| |||
902 | 907 | | |
903 | 908 | | |
904 | 909 | | |
905 | | - | |
906 | | - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
907 | 913 | | |
908 | 914 | | |
909 | 915 | | |
910 | 916 | | |
911 | | - | |
912 | 917 | | |
913 | | - | |
914 | 918 | | |
915 | 919 | | |
916 | 920 | | |
| |||
1146 | 1150 | | |
1147 | 1151 | | |
1148 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1149 | 1186 | | |
1150 | 1187 | | |
1151 | 1188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4515 | 4515 | | |
4516 | 4516 | | |
4517 | 4517 | | |
| 4518 | + | |
4518 | 4519 | | |
4519 | 4520 | | |
4520 | 4521 | | |
| |||
4571 | 4572 | | |
4572 | 4573 | | |
4573 | 4574 | | |
4574 | | - | |
| 4575 | + | |
4575 | 4576 | | |
4576 | 4577 | | |
4577 | 4578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3200 | 3200 | | |
3201 | 3201 | | |
3202 | 3202 | | |
3203 | | - | |
3204 | | - | |
3205 | | - | |
3206 | | - | |
3207 | | - | |
3208 | | - | |
3209 | | - | |
3210 | | - | |
3211 | | - | |
3212 | | - | |
3213 | | - | |
3214 | | - | |
| 3203 | + | |
3215 | 3204 | | |
3216 | 3205 | | |
3217 | 3206 | | |
| |||
0 commit comments