Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2024-10-01 10:01:10 +01:00
9 changed files with 123 additions and 49 deletions

View File

@ -1164,6 +1164,24 @@ window_pane_reset_mode_all(struct window_pane *wp)
window_pane_reset_mode(wp);
}
static void
window_pane_copy_paste(struct window_pane *wp, char *buf, size_t len)
{
struct window_pane *loop;
TAILQ_FOREACH(loop, &wp->window->panes, entry) {
if (loop != wp &&
TAILQ_EMPTY(&loop->modes) &&
loop->fd != -1 &&
(~loop->flags & PANE_INPUTOFF) &&
window_pane_visible(loop) &&
options_get_number(loop->options, "synchronize-panes")) {
log_debug("%s: %.*s", __func__, (int)len, buf);
bufferevent_write(loop->event, buf, len);
}
}
}
static void
window_pane_copy_key(struct window_pane *wp, key_code key)
{
@ -1180,6 +1198,22 @@ window_pane_copy_key(struct window_pane *wp, key_code key)
}
}
void
window_pane_paste(struct window_pane *wp, char *buf, size_t len)
{
if (!TAILQ_EMPTY(&wp->modes))
return;
if (wp->fd == -1 || wp->flags & PANE_INPUTOFF)
return;
log_debug("%s: %.*s", __func__, (int)len, buf);
bufferevent_write(wp->event, buf, len);
if (options_get_number(wp->options, "synchronize-panes"))
window_pane_copy_paste(wp, buf, len);
}
int
window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
struct winlink *wl, key_code key, struct mouse_event *m)
@ -1662,15 +1696,7 @@ window_set_fill_character(struct window *w)
void
window_pane_default_cursor(struct window_pane *wp)
{
struct screen *s = wp->screen;
int c;
c = options_get_number(wp->options, "cursor-colour");
s->default_ccolour = c;
c = options_get_number(wp->options, "cursor-style");
s->default_mode = 0;
screen_set_cursor_style(c, &s->default_cstyle, &s->default_mode);
screen_set_default_cursor(wp->screen, wp->options);
}
int