Add feature for progress bar and pass to outside terminal, GitHu issue

4972 from Eric Dorland.
This commit is contained in:
nicm
2026-04-22 07:25:17 +00:00
parent 7a0cc03532
commit bc15723f7f
6 changed files with 50 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ static void server_client_check_redraw(struct client *);
static void server_client_check_modes(struct client *);
static void server_client_set_title(struct client *);
static void server_client_set_path(struct client *);
static void server_client_set_progress_bar(struct client *);
static void server_client_reset_state(struct client *);
static void server_client_update_latest(struct client *);
static void server_client_dispatch(struct imsg *, void *);
@@ -2060,6 +2061,7 @@ server_client_check_redraw(struct client *c)
server_client_set_title(c);
server_client_set_path(c);
}
server_client_set_progress_bar(c);
screen_redraw_screen(c);
}
@@ -2126,6 +2128,23 @@ server_client_set_path(struct client *c)
}
}
/* Set client progress bar. */
static void
server_client_set_progress_bar(struct client *c)
{
struct session *s = c->session;
struct progress_bar *pane_pb;
if (s->curw == NULL)
return;
pane_pb = &s->curw->window->active->base.progress_bar;
if (pane_pb->state == c->progress_bar.state &&
pane_pb->progress == c->progress_bar.progress)
return;
memcpy(&c->progress_bar, pane_pb, sizeof c->progress_bar);
tty_set_progress_bar(&c->tty, &c->progress_bar);
}
/* Dispatch message from client. */
static void
server_client_dispatch(struct imsg *imsg, void *arg)