mirror of
https://github.com/tmux/tmux.git
synced 2026-10-07 01:55:49 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master: Change cellused/size to 16 bits and time to 32 bits in grid_line and add the OSC 133 positions (size stays the same).
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: cmd-capture-pane.c,v 1.67 2026/07/02 10:34:14 nicm Exp $ */
|
/* $OpenBSD: cmd-capture-pane.c,v 1.68 2026/07/20 11:16:33 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Jonathan Alvarado <radobobo@users.sourceforge.net>
|
* Copyright (c) 2009 Jonathan Alvarado <radobobo@users.sourceforge.net>
|
||||||
@@ -134,6 +134,7 @@ cmd_capture_pane_grid(struct window_pane *wp, size_t *len)
|
|||||||
struct screen *s = &wp->base;
|
struct screen *s = &wp->base;
|
||||||
struct grid *gd = s->grid;
|
struct grid *gd = s->grid;
|
||||||
struct grid_line *gl;
|
struct grid_line *gl;
|
||||||
|
struct osc133_data *od;
|
||||||
char *buf = xstrdup(""), *line;
|
char *buf = xstrdup(""), *line;
|
||||||
char p[11];
|
char p[11];
|
||||||
u_int yy, xx, total = gd->hsize + gd->sy;
|
u_int yy, xx, total = gd->hsize + gd->sy;
|
||||||
@@ -149,9 +150,20 @@ cmd_capture_pane_grid(struct window_pane *wp, size_t *len)
|
|||||||
snprintf(p, sizeof p, "-");
|
snprintf(p, sizeof p, "-");
|
||||||
else
|
else
|
||||||
snprintf(p, sizeof p, "%u", yy - gd->hsize);
|
snprintf(p, sizeof p, "%u", yy - gd->hsize);
|
||||||
xasprintf(&line, "\tL %u (%s) flags=%s[%x] %u/%u\n", yy,
|
od = &gl->osc133_data;
|
||||||
p, grid_line_flags_string(gl->flags), gl->flags,
|
if (gl->flags & GRID_LINE_OSC133_FLAGS) {
|
||||||
gl->cellused, gl->cellsize);
|
xasprintf(&line, "\tL %u (%s) flags=%s[%x] "
|
||||||
|
"%u/%u osc133=%u,%u,%u,%u,%u\n", yy, p,
|
||||||
|
grid_line_flags_string(gl->flags), gl->flags,
|
||||||
|
gl->cellused, gl->cellsize, od->prompt_col,
|
||||||
|
od->cmd_col, od->out_start_col,
|
||||||
|
od->out_end_col, od->exit_status);
|
||||||
|
} else {
|
||||||
|
xasprintf(&line, "\tL %u (%s) flags=%s[%x] "
|
||||||
|
"%u/%u\n", yy, p,
|
||||||
|
grid_line_flags_string(gl->flags), gl->flags,
|
||||||
|
gl->cellused, gl->cellsize);
|
||||||
|
}
|
||||||
buf = cmd_capture_pane_append(buf, len, line, strlen(line));
|
buf = cmd_capture_pane_append(buf, len, line, strlen(line));
|
||||||
free(line);
|
free(line);
|
||||||
|
|
||||||
|
|||||||
31
grid.c
31
grid.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: grid.c,v 1.153 2026/07/02 08:51:05 nicm Exp $ */
|
/* $OpenBSD: grid.c,v 1.154 2026/07/20 11:16:33 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -233,6 +233,25 @@ grid_get_line(struct grid *gd, u_int line)
|
|||||||
return (&gd->linedata[line]);
|
return (&gd->linedata[line]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get line time. */
|
||||||
|
time_t
|
||||||
|
grid_line_time(const struct grid_line *gl)
|
||||||
|
{
|
||||||
|
if (gl->time == 0)
|
||||||
|
return (0);
|
||||||
|
return (start_time.tv_sec + gl->time - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set line time. */
|
||||||
|
static void
|
||||||
|
grid_line_set_time(struct grid_line *gl)
|
||||||
|
{
|
||||||
|
if (current_time == 0)
|
||||||
|
gl->time = 0;
|
||||||
|
else
|
||||||
|
gl->time = current_time - start_time.tv_sec + 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Adjust number of lines. */
|
/* Adjust number of lines. */
|
||||||
void
|
void
|
||||||
grid_adjust_lines(struct grid *gd, u_int lines)
|
grid_adjust_lines(struct grid *gd, u_int lines)
|
||||||
@@ -486,7 +505,7 @@ grid_scroll_history(struct grid *gd, u_int bg)
|
|||||||
|
|
||||||
gd->hscrolled++;
|
gd->hscrolled++;
|
||||||
grid_compact_line(&gd->linedata[gd->hsize]);
|
grid_compact_line(&gd->linedata[gd->hsize]);
|
||||||
gd->linedata[gd->hsize].time = current_time;
|
grid_line_set_time(&gd->linedata[gd->hsize]);
|
||||||
gd->hsize++;
|
gd->hsize++;
|
||||||
gd->scroll_added++;
|
gd->scroll_added++;
|
||||||
}
|
}
|
||||||
@@ -528,7 +547,7 @@ grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower, u_int bg)
|
|||||||
|
|
||||||
/* Move the line into the history. */
|
/* Move the line into the history. */
|
||||||
memcpy(gl_history, gl_upper, sizeof *gl_history);
|
memcpy(gl_history, gl_upper, sizeof *gl_history);
|
||||||
gl_history->time = current_time;
|
grid_line_set_time(gl_history);
|
||||||
|
|
||||||
/* Then move the region up and clear the bottom line. */
|
/* Then move the region up and clear the bottom line. */
|
||||||
memmove(gl_upper, gl_upper + 1, (lower - upper) * sizeof *gl_upper);
|
memmove(gl_upper, gl_upper + 1, (lower - upper) * sizeof *gl_upper);
|
||||||
@@ -1701,8 +1720,14 @@ grid_line_flags_string(int flags)
|
|||||||
strlcat(s, "DEAD,", sizeof s);
|
strlcat(s, "DEAD,", sizeof s);
|
||||||
if (flags & GRID_LINE_START_PROMPT)
|
if (flags & GRID_LINE_START_PROMPT)
|
||||||
strlcat(s, "START_PROMPT,", sizeof s);
|
strlcat(s, "START_PROMPT,", sizeof s);
|
||||||
|
if (flags & GRID_LINE_SECOND_PROMPT)
|
||||||
|
strlcat(s, "SECOND_PROMPT,", sizeof s);
|
||||||
|
if (flags & GRID_LINE_START_COMMAND)
|
||||||
|
strlcat(s, "START_COMMAND,", sizeof s);
|
||||||
if (flags & GRID_LINE_START_OUTPUT)
|
if (flags & GRID_LINE_START_OUTPUT)
|
||||||
strlcat(s, "START_OUTPUT,", sizeof s);
|
strlcat(s, "START_OUTPUT,", sizeof s);
|
||||||
|
if (flags & GRID_LINE_END_OUTPUT)
|
||||||
|
strlcat(s, "END_OUTPUT,", sizeof s);
|
||||||
if (flags & GRID_LINE_HYPERLINK)
|
if (flags & GRID_LINE_HYPERLINK)
|
||||||
strlcat(s, "HYPERLINK,", sizeof s);
|
strlcat(s, "HYPERLINK,", sizeof s);
|
||||||
if (*s == '\0')
|
if (*s == '\0')
|
||||||
|
|||||||
113
input.c
113
input.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: input.c,v 1.268 2026/07/13 15:03:03 nicm Exp $ */
|
/* $OpenBSD: input.c,v 1.269 2026/07/20 11:16:33 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -174,8 +174,6 @@ static void input_osc_110(struct input_ctx *, const char *);
|
|||||||
static void input_osc_111(struct input_ctx *, const char *);
|
static void input_osc_111(struct input_ctx *, const char *);
|
||||||
static void input_osc_112(struct input_ctx *, const char *);
|
static void input_osc_112(struct input_ctx *, const char *);
|
||||||
static void input_osc_133(struct input_ctx *, const char *);
|
static void input_osc_133(struct input_ctx *, const char *);
|
||||||
static void input_fire_pane_title_changed(struct window_pane *,
|
|
||||||
const char *);
|
|
||||||
|
|
||||||
/* Transition entry/exit handlers. */
|
/* Transition entry/exit handlers. */
|
||||||
static void input_clear(struct input_ctx *);
|
static void input_clear(struct input_ctx *);
|
||||||
@@ -212,21 +210,6 @@ static int input_end_bel(struct input_ctx *);
|
|||||||
/* Command table comparison function. */
|
/* Command table comparison function. */
|
||||||
static int input_table_compare(const void *, const void *);
|
static int input_table_compare(const void *, const void *);
|
||||||
|
|
||||||
static void
|
|
||||||
input_fire_pane_title_changed(struct window_pane *wp, const char *title)
|
|
||||||
{
|
|
||||||
struct event_payload *ep;
|
|
||||||
struct cmd_find_state fs;
|
|
||||||
|
|
||||||
ep = event_payload_create();
|
|
||||||
cmd_find_from_pane(&fs, wp, 0);
|
|
||||||
event_payload_set_target(ep, &fs);
|
|
||||||
event_payload_set_pane(ep, "pane", wp);
|
|
||||||
event_payload_set_window(ep, "window", wp->window);
|
|
||||||
event_payload_set_string(ep, "new_title", "%s", title);
|
|
||||||
events_fire("pane-title-changed", ep);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Command table entry. */
|
/* Command table entry. */
|
||||||
struct input_table_entry {
|
struct input_table_entry {
|
||||||
int ch;
|
int ch;
|
||||||
@@ -809,6 +792,22 @@ input_stop_utf8(struct input_ctx *ictx)
|
|||||||
ictx->utf8started = 0;
|
ictx->utf8started = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fire a title changed event. */
|
||||||
|
static void
|
||||||
|
input_fire_pane_title_changed(struct window_pane *wp, const char *title)
|
||||||
|
{
|
||||||
|
struct event_payload *ep;
|
||||||
|
struct cmd_find_state fs;
|
||||||
|
|
||||||
|
ep = event_payload_create();
|
||||||
|
cmd_find_from_pane(&fs, wp, 0);
|
||||||
|
event_payload_set_target(ep, &fs);
|
||||||
|
event_payload_set_pane(ep, "pane", wp);
|
||||||
|
event_payload_set_window(ep, "window", wp->window);
|
||||||
|
event_payload_set_string(ep, "new_title", "%s", title);
|
||||||
|
events_fire("pane-title-changed", ep);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Timer - if this expires then have been waiting for a terminator for too
|
* Timer - if this expires then have been waiting for a terminator for too
|
||||||
* long, so reset to ground.
|
* long, so reset to ground.
|
||||||
@@ -3192,6 +3191,35 @@ input_osc_112(struct input_ctx *ictx, const char *p)
|
|||||||
screen_set_cursor_colour(ictx->ctx.s, -1);
|
screen_set_cursor_colour(ictx->ctx.s, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Parse the OSC 133 D exit status. */
|
||||||
|
static int
|
||||||
|
input_osc_133_exit_status(const char *p)
|
||||||
|
{
|
||||||
|
const char *end;
|
||||||
|
char *copy;
|
||||||
|
const char *errstr;
|
||||||
|
long long status;
|
||||||
|
|
||||||
|
if (p[1] != ';' || p[2] == '\0' || strchr(p + 2, '=') == p + 2)
|
||||||
|
return (0);
|
||||||
|
end = strchr(p + 2, ';');
|
||||||
|
if (end == p + 2)
|
||||||
|
return (0);
|
||||||
|
if (end == NULL)
|
||||||
|
copy = xstrdup(p + 2);
|
||||||
|
else
|
||||||
|
copy = xstrndup(p + 2, end - (p + 2));
|
||||||
|
if (strchr(copy, '=') != NULL) {
|
||||||
|
free(copy);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
status = strtonum(copy, 0, 255, &errstr);
|
||||||
|
free(copy);
|
||||||
|
if (errstr != NULL)
|
||||||
|
return (255);
|
||||||
|
return (status);
|
||||||
|
}
|
||||||
|
|
||||||
/* Fire an OSC 133 command event. */
|
/* Fire an OSC 133 command event. */
|
||||||
static void
|
static void
|
||||||
input_fire_command_event(struct window_pane *wp, const char *name)
|
input_fire_command_event(struct window_pane *wp, const char *name)
|
||||||
@@ -3237,27 +3265,51 @@ static void
|
|||||||
input_osc_133(struct input_ctx *ictx, const char *p)
|
input_osc_133(struct input_ctx *ictx, const char *p)
|
||||||
{
|
{
|
||||||
struct window_pane *wp = ictx->wp;
|
struct window_pane *wp = ictx->wp;
|
||||||
struct grid *gd = ictx->ctx.s->grid;
|
struct screen *s = ictx->ctx.s;
|
||||||
u_int line = ictx->ctx.s->cy + gd->hsize;
|
struct grid *gd = s->grid;
|
||||||
|
u_int line = s->cy + gd->hsize;
|
||||||
struct grid_line *gl = NULL;
|
struct grid_line *gl = NULL;
|
||||||
const char *errstr;
|
const char *cp;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (line <= gd->hsize + gd->sy - 1)
|
if (line < gd->hsize + gd->sy)
|
||||||
gl = grid_get_line(gd, line);
|
gl = grid_get_line(gd, line);
|
||||||
|
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case 'A':
|
case 'A':
|
||||||
if (gl != NULL)
|
case 'N':
|
||||||
|
if (gl != NULL) {
|
||||||
|
memset(&gl->osc133_data, 0, sizeof gl->osc133_data);
|
||||||
|
gl->osc133_data.prompt_col = s->cx;
|
||||||
gl->flags |= GRID_LINE_START_PROMPT;
|
gl->flags |= GRID_LINE_START_PROMPT;
|
||||||
|
}
|
||||||
if (wp != NULL) {
|
if (wp != NULL) {
|
||||||
wp->last_prompt_time = time(NULL);
|
wp->last_prompt_time = time(NULL);
|
||||||
events_fire_pane("pane-shell-prompt", wp);
|
events_fire_pane("pane-shell-prompt", wp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'P':
|
||||||
|
if (gl != NULL) {
|
||||||
|
cp = strstr(p, ";k=s");
|
||||||
|
if (cp != NULL && (cp[4] == ';' || cp[4] == '\0'))
|
||||||
|
gl->flags |= GRID_LINE_SECOND_PROMPT;
|
||||||
|
else
|
||||||
|
gl->flags |= GRID_LINE_START_PROMPT;
|
||||||
|
gl->osc133_data.prompt_col = s->cx;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'B':
|
||||||
|
case 'I':
|
||||||
|
if (gl != NULL) {
|
||||||
|
gl->flags |= GRID_LINE_START_COMMAND;
|
||||||
|
gl->osc133_data.cmd_col = s->cx;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
if (gl != NULL)
|
if (gl != NULL) {
|
||||||
gl->flags |= GRID_LINE_START_OUTPUT;
|
gl->flags |= GRID_LINE_START_OUTPUT;
|
||||||
|
gl->osc133_data.out_start_col = s->cx;
|
||||||
|
}
|
||||||
if (wp != NULL) {
|
if (wp != NULL) {
|
||||||
wp->cmd_start_time = time(NULL);
|
wp->cmd_start_time = time(NULL);
|
||||||
wp->cmd_end_time = 0;
|
wp->cmd_end_time = 0;
|
||||||
@@ -3267,17 +3319,18 @@ input_osc_133(struct input_ctx *ictx, const char *p)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
|
status = input_osc_133_exit_status(p);
|
||||||
if (wp != NULL) {
|
if (wp != NULL) {
|
||||||
wp->cmd_end_time = time(NULL);
|
wp->cmd_end_time = time(NULL);
|
||||||
wp->flags &= ~PANE_CMDRUNNING;
|
wp->flags &= ~PANE_CMDRUNNING;
|
||||||
wp->cmd_status = -1;
|
wp->cmd_status = status;
|
||||||
if (p[1] == ';' && p[2] != '\0') {
|
|
||||||
status = strtonum(p + 2, 0, INT_MAX, &errstr);
|
|
||||||
if (errstr == NULL)
|
|
||||||
wp->cmd_status = status;
|
|
||||||
}
|
|
||||||
input_fire_command_event(wp, "pane-command-finished");
|
input_fire_command_event(wp, "pane-command-finished");
|
||||||
}
|
}
|
||||||
|
if (gl != NULL) {
|
||||||
|
gl->flags |= GRID_LINE_END_OUTPUT;
|
||||||
|
gl->osc133_data.out_end_col = s->cx;
|
||||||
|
gl->osc133_data.exit_status = status;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: screen-write.c,v 1.283 2026/07/09 07:35:05 nicm Exp $ */
|
/* $OpenBSD: screen-write.c,v 1.284 2026/07/20 11:16:33 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1606,6 +1606,7 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg)
|
|||||||
struct grid_line *gl;
|
struct grid_line *gl;
|
||||||
u_int sx = screen_size_x(s);
|
u_int sx = screen_size_x(s);
|
||||||
struct screen_write_citem *ci = ctx->item;
|
struct screen_write_citem *ci = ctx->item;
|
||||||
|
struct osc133_data od;
|
||||||
u_int flags;
|
u_int flags;
|
||||||
|
|
||||||
gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
|
gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
|
||||||
@@ -1617,10 +1618,14 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg)
|
|||||||
ctx->wp->flags |= PANE_REDRAW;
|
ctx->wp->flags |= PANE_REDRAW;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
flags = gl->flags & (GRID_LINE_START_PROMPT|GRID_LINE_START_OUTPUT);
|
flags = gl->flags &
|
||||||
|
(GRID_LINE_START_PROMPT|GRID_LINE_START_OUTPUT|
|
||||||
|
GRID_LINE_OSC133_FLAGS);
|
||||||
|
memcpy(&od, &gl->osc133_data, sizeof od);
|
||||||
grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
|
grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
|
||||||
gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
|
gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
|
||||||
gl->flags |= flags;
|
gl->flags |= flags;
|
||||||
|
memcpy(&gl->osc133_data, &od, sizeof gl->osc133_data);
|
||||||
|
|
||||||
screen_write_collect_clear(ctx, s->cy, 1);
|
screen_write_collect_clear(ctx, s->cy, 1);
|
||||||
ci->x = 0;
|
ci->x = 0;
|
||||||
|
|||||||
38
tmux.h
38
tmux.h
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: tmux.h,v 1.1410 2026/07/19 19:53:11 nicm Exp $ */
|
/* $OpenBSD: tmux.h,v 1.1411 2026/07/20 11:16:33 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -809,8 +809,19 @@ struct colour_palette {
|
|||||||
#define GRID_LINE_EXTENDED 0x2
|
#define GRID_LINE_EXTENDED 0x2
|
||||||
#define GRID_LINE_DEAD 0x4
|
#define GRID_LINE_DEAD 0x4
|
||||||
#define GRID_LINE_START_PROMPT 0x8
|
#define GRID_LINE_START_PROMPT 0x8
|
||||||
#define GRID_LINE_START_OUTPUT 0x10
|
#define GRID_LINE_SECOND_PROMPT 0x10
|
||||||
#define GRID_LINE_HYPERLINK 0x20
|
#define GRID_LINE_START_COMMAND 0x20
|
||||||
|
#define GRID_LINE_START_OUTPUT 0x40
|
||||||
|
#define GRID_LINE_END_OUTPUT 0x80
|
||||||
|
#define GRID_LINE_HYPERLINK 0x100
|
||||||
|
|
||||||
|
/* All OSC 133 flags. */
|
||||||
|
#define GRID_LINE_OSC133_FLAGS \
|
||||||
|
(GRID_LINE_START_PROMPT| \
|
||||||
|
GRID_LINE_SECOND_PROMPT| \
|
||||||
|
GRID_LINE_START_COMMAND| \
|
||||||
|
GRID_LINE_START_OUTPUT| \
|
||||||
|
GRID_LINE_END_OUTPUT)
|
||||||
|
|
||||||
/* Grid string flags. */
|
/* Grid string flags. */
|
||||||
#define GRID_STRING_WITH_SEQUENCES 0x1
|
#define GRID_STRING_WITH_SEQUENCES 0x1
|
||||||
@@ -879,17 +890,27 @@ struct grid_cell_entry {
|
|||||||
u_char flags;
|
u_char flags;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
/* OSC 133 data for a grid line. */
|
||||||
|
struct osc133_data {
|
||||||
|
u_short prompt_col;
|
||||||
|
u_short cmd_col;
|
||||||
|
u_short out_start_col;
|
||||||
|
u_short out_end_col;
|
||||||
|
u_char exit_status;
|
||||||
|
};
|
||||||
|
|
||||||
/* Grid line. */
|
/* Grid line. */
|
||||||
struct grid_line {
|
struct grid_line {
|
||||||
struct grid_cell_entry *celldata;
|
struct grid_cell_entry *celldata;
|
||||||
u_int cellused;
|
|
||||||
u_int cellsize;
|
|
||||||
|
|
||||||
struct grid_extd_entry *extddata;
|
struct grid_extd_entry *extddata;
|
||||||
|
|
||||||
|
u_short cellused;
|
||||||
|
u_short cellsize;
|
||||||
u_int extdsize;
|
u_int extdsize;
|
||||||
|
|
||||||
int flags;
|
u_int time;
|
||||||
time_t time;
|
struct osc133_data osc133_data;
|
||||||
|
u_short flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Entire grid of cells. */
|
/* Entire grid of cells. */
|
||||||
@@ -3451,6 +3472,7 @@ int grid_compare(struct grid *, struct grid *);
|
|||||||
const char *grid_line_flags_string(int);
|
const char *grid_line_flags_string(int);
|
||||||
const char *grid_cell_flags_string(int);
|
const char *grid_cell_flags_string(int);
|
||||||
const char *grid_cell_attr_string(int);
|
const char *grid_cell_attr_string(int);
|
||||||
|
time_t grid_line_time(const struct grid_line *);
|
||||||
void grid_collect_history(struct grid *, int);
|
void grid_collect_history(struct grid *, int);
|
||||||
void grid_remove_history(struct grid *, u_int );
|
void grid_remove_history(struct grid *, u_int );
|
||||||
void grid_scroll_history(struct grid *, u_int);
|
void grid_scroll_history(struct grid *, u_int);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: window-copy.c,v 1.421 2026/07/14 17:17:18 nicm Exp $ */
|
/* $OpenBSD: window-copy.c,v 1.422 2026/07/20 11:16:33 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1107,9 +1107,11 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
|
|||||||
u_int hsize = screen_hsize(data->backing);
|
u_int hsize = screen_hsize(data->backing);
|
||||||
u_int position, limit;
|
u_int position, limit;
|
||||||
struct grid_line *gl;
|
struct grid_line *gl;
|
||||||
|
time_t t;
|
||||||
|
|
||||||
gl = grid_get_line(data->backing->grid, hsize - data->oy);
|
gl = grid_get_line(data->backing->grid, hsize - data->oy);
|
||||||
format_add(ft, "top_line_time", "%llu", (unsigned long long)gl->time);
|
t = grid_line_time(gl);
|
||||||
|
format_add(ft, "top_line_time", "%llu", (unsigned long long)t);
|
||||||
|
|
||||||
format_add(ft, "scroll_position", "%d", data->oy);
|
format_add(ft, "scroll_position", "%d", data->oy);
|
||||||
if (window_copy_line_number_is_absolute(wme)) {
|
if (window_copy_line_number_is_absolute(wme)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user