mirror of
https://github.com/wez/wezterm.git
synced 2024-09-11 14:25:57 +03:00
rudimentary attempt at fixing line wrap, part 2
This feels more like a workaround. I would expect, that when a program prints exactly as many chars as there a columns, the cursor would wrap into the next line. This would be possible by putting another "if self.wrap_next {" block after the for loop in the performer. But it seems like there are programs that depend on it not doing that, e.g. fish shell. It prints a full line of mostly spaces and then does \r, expecting the cursor is still on the same line. This way, the cursor overflows into an extra column, but I'm sure this has its own disadvantages. Perhaps this commit should not be used at all.
This commit is contained in:
parent
8b7c004e94
commit
ed58024357
@ -1001,7 +1001,11 @@ impl TerminalState {
|
|||||||
if self.dec_origin_mode {
|
if self.dec_origin_mode {
|
||||||
self.left_and_right_margins.end
|
self.left_and_right_margins.end
|
||||||
} else {
|
} else {
|
||||||
self.screen().physical_cols
|
// We allow 1 extra for the cursor x position
|
||||||
|
// to account for some resize/rewrap scenarios
|
||||||
|
// where we don't want to forget that the
|
||||||
|
// cursor belongs to a wrapped line
|
||||||
|
self.screen().physical_cols + 1
|
||||||
} as i64
|
} as i64
|
||||||
- 1,
|
- 1,
|
||||||
)
|
)
|
||||||
|
@ -208,8 +208,11 @@ impl<'a> Performer<'a> {
|
|||||||
self.screen_mut()
|
self.screen_mut()
|
||||||
.set_cell_grapheme(x, y, g, print_width, attr_edited, seqno);
|
.set_cell_grapheme(x, y, g, print_width, attr_edited, seqno);
|
||||||
|
|
||||||
if !wrappable {
|
if !wrappable || self.cursor.x + print_width == width {
|
||||||
self.cursor.x += print_width;
|
self.cursor.x += print_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if !wrappable {
|
||||||
self.wrap_next = false;
|
self.wrap_next = false;
|
||||||
} else {
|
} else {
|
||||||
self.wrap_next = self.dec_auto_wrap;
|
self.wrap_next = self.dec_auto_wrap;
|
||||||
|
Loading…
Reference in New Issue
Block a user