On 2014-04-30 11:03 +0000, mMontu wrote:
> > Just to clarify: you are running list-panes from the tmux command
> > line?
> Indeed, I wasn't even aware of any other way of running this command.
Yes, you can use "tmux list-panes" from a shell instead of the tmux
command line and you won't see this sort of problems.
> Exactly, the lines aren't wrapping and it is not possible to make the
> cursor run beyond the last character on the screen.
I don't know the history of this part of the code and I don't know
whether this is working as intended or is a bug. Maybe the maintainers
can comment on that? Just to give more context: the problem is that the
output generated from list-windows or things like run-shell "seq -sx
1000" isn't wrapped nor is correctly reflowed when resized. In any case,
I've appended a short patch which restores this ability for tmux.
diff --git a/window-copy.c b/window-copy.c
index fd03e10..0eada97 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -236,7 +236,6 @@ window_copy_init_for_output(struct window_pane *wp)
data->backing = xmalloc(sizeof *data->backing);
screen_init(data->backing, screen_size_x(&wp->base),
screen_size_y(&wp->base), UINT_MAX);
- data->backing->mode &= ~MODE_WRAP;
}
void
@@ -277,7 +276,7 @@ window_copy_vadd(struct window_pane *wp, const char *fmt,
va_list ap)
struct screen_write_ctx back_ctx, ctx;
struct grid_cell gc;
int utf8flag;
- u_int old_hsize;
+ u_int old_hsize, old_cy;
if (backing == &wp->base)
return;
@@ -296,6 +295,7 @@ window_copy_vadd(struct window_pane *wp, const char *fmt,
va_list ap)
screen_write_linefeed(&back_ctx, 0);
} else
data->backing_written = 1;
+ old_cy = backing->cy;
screen_write_vnputs(&back_ctx, 0, &gc, utf8flag, fmt, ap);
screen_write_stop(&back_ctx);
@@ -310,9 +310,8 @@ window_copy_vadd(struct window_pane *wp, const char *fmt,
va_list ap)
if (screen_hsize(data->backing))
window_copy_redraw_lines(wp, 0, 1);
- /* Write the line, if it's visible. */
- if (backing->cy + data->oy < screen_size_y(backing))
- window_copy_redraw_lines(wp, backing->cy, 1);
+ /* Write the new lines. */
+ window_copy_redraw_lines(wp, old_cy, backing->cy - old_cy + 1);
screen_write_stop(&ctx);
}
@@ -342,9 +341,9 @@ window_copy_resize(struct window_pane *wp, u_int sx, u_int
sy)
struct screen *s = &data->screen;
struct screen_write_ctx ctx;
- screen_resize(s, sx, sy, 0);
+ screen_resize(s, sx, sy, 1);
if (data->backing != &wp->base)
- screen_resize(data->backing, sx, sy, 0);
+ screen_resize(data->backing, sx, sy, 1);
if (data->cy > sy - 1)
data->cy = sy - 1;
--
Balazs
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users