Handle OSC 9;4 progress bar sequence and store in format variables, from

Eric Dorland in GitHub issue 4954.
This commit is contained in:
nicm
2026-04-03 09:14:27 +00:00
parent 7497db6e37
commit bdd78ce38e
4 changed files with 112 additions and 1 deletions

16
tmux.h
View File

@@ -920,6 +920,20 @@ enum screen_cursor_style {
SCREEN_CURSOR_BAR
};
/* Progress bar, OSC 9;4. */
enum progress_bar_state {
PROGRESS_BAR_HIDDEN = 0,
PROGRESS_BAR_NORMAL = 1,
PROGRESS_BAR_ERROR = 2,
PROGRESS_BAR_INDETERMINATE = 3,
PROGRESS_BAR_PAUSED = 4
};
struct progress_bar {
enum progress_bar_state state;
int progress;
};
/* Virtual screen. */
struct screen_sel;
struct screen_titles;
@@ -956,6 +970,7 @@ struct screen {
struct screen_write_cline *write_list;
struct hyperlinks *hyperlinks;
struct progress_bar progress_bar;
};
/* Screen write context. */
@@ -3233,6 +3248,7 @@ int screen_set_title(struct screen *, const char *);
void screen_set_path(struct screen *, const char *);
void screen_push_title(struct screen *);
void screen_pop_title(struct screen *);
void screen_set_progress_bar(struct screen *, enum progress_bar_state, int);
void screen_resize(struct screen *, u_int, u_int, int);
void screen_resize_cursor(struct screen *, u_int, u_int, int, int, int);
void screen_set_selection(struct screen *, u_int, u_int, u_int, u_int,