don't rewrap the alt screen on resize
It is only used by applications that repaint on a resize event, and us rewrapping makes it harder to have an ideal view afterwards. This change makes us more consistent with VTE's behavior in this case. This helps with https://github.com/wez/wezterm/issues/574 but doesn't completely resolve it.
This commit is contained in:
1 parent
b4876da2aa
commit
a2bad801d2
1 file changed
+8
-2
+8
-2
@@ -27,6 +27,9 @@ pub struct Screen {
|
||||
|
||||
/// config so we can access Maximum number of lines of scrollback
|
||||
config: Arc<dyn TerminalConfiguration>,
|
||||
|
||||
/// Whether scrollback is allowed; this is another way of saying
|
||||
/// that we're the primary rather than the alternate screen.
|
||||
allow_scrollback: bool,
|
||||
|
||||
/// Physical, visible height of the screen (not including scrollback)
|
||||
@@ -172,11 +175,14 @@ impl Screen {
|
||||
}
|
||||
}
|
||||
|
||||
let (cursor_x, cursor_y) = if physical_cols != self.physical_cols {
|
||||
let (cursor_x, cursor_y) = if self.allow_scrollback && physical_cols != self.physical_cols {
|
||||
// Check to see if we need to rewrap lines that were
|
||||
// wrapped due to reaching the right hand side of the terminal.
|
||||
// For each one that we find, we need to join it with its
|
||||
// successor and then re-split it
|
||||
// successor and then re-split it.
|
||||
// We only do this for the primary, and not for the alternate
|
||||
// screen (hence the check for allow_scrollback), to avoid
|
||||
// conflicting screen updates with full screen apps.
|
||||
self.rewrap_lines(physical_cols, physical_rows, cursor.x, cursor_phys)
|
||||
} else {
|
||||
(cursor.x, cursor_phys)
|
||||
|
||||
Reference in new issue
Block a user