mirror of
https://github.com/tmux/tmux.git
synced 2024-12-14 02:48:47 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
5a55d1390a
6
alerts.c
6
alerts.c
@ -200,7 +200,7 @@ alerts_check_bell(struct window *w)
|
|||||||
* not check WINLINK_BELL).
|
* not check WINLINK_BELL).
|
||||||
*/
|
*/
|
||||||
s = wl->session;
|
s = wl->session;
|
||||||
if (s->curw != wl) {
|
if (s->curw != wl || s->attached == 0) {
|
||||||
wl->flags |= WINLINK_BELL;
|
wl->flags |= WINLINK_BELL;
|
||||||
server_status_session(s);
|
server_status_session(s);
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ alerts_check_activity(struct window *w)
|
|||||||
if (wl->flags & WINLINK_ACTIVITY)
|
if (wl->flags & WINLINK_ACTIVITY)
|
||||||
continue;
|
continue;
|
||||||
s = wl->session;
|
s = wl->session;
|
||||||
if (s->curw != wl) {
|
if (s->curw != wl || s->attached == 0) {
|
||||||
wl->flags |= WINLINK_ACTIVITY;
|
wl->flags |= WINLINK_ACTIVITY;
|
||||||
server_status_session(s);
|
server_status_session(s);
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ alerts_check_silence(struct window *w)
|
|||||||
if (wl->flags & WINLINK_SILENCE)
|
if (wl->flags & WINLINK_SILENCE)
|
||||||
continue;
|
continue;
|
||||||
s = wl->session;
|
s = wl->session;
|
||||||
if (s->curw != wl) {
|
if (s->curw != wl || s->attached == 0) {
|
||||||
wl->flags |= WINLINK_SILENCE;
|
wl->flags |= WINLINK_SILENCE;
|
||||||
server_status_session(s);
|
server_status_session(s);
|
||||||
}
|
}
|
||||||
|
36
input.c
36
input.c
@ -2459,6 +2459,24 @@ input_osc_parse_colour(const char *p, u_int *r, u_int *g, u_int *b)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Reply to a colour request. */
|
||||||
|
static void
|
||||||
|
input_osc_colour_reply(struct input_ctx *ictx, u_int n, int c)
|
||||||
|
{
|
||||||
|
u_char r, g, b;
|
||||||
|
const char *end;
|
||||||
|
|
||||||
|
if (c == 8 || (~c & COLOUR_FLAG_RGB))
|
||||||
|
return;
|
||||||
|
colour_split_rgb(c, &r, &g, &b);
|
||||||
|
|
||||||
|
if (ictx->input_end == INPUT_END_BEL)
|
||||||
|
end = "\007";
|
||||||
|
else
|
||||||
|
end = "\033\\";
|
||||||
|
input_reply(ictx, "\033]%u;rgb:%02hhx/%02hhx/%02hhx%s", n, r, g, b, end);
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle the OSC 4 sequence for setting (multiple) palette entries. */
|
/* Handle the OSC 4 sequence for setting (multiple) palette entries. */
|
||||||
static void
|
static void
|
||||||
input_osc_4(struct input_ctx *ictx, const char *p)
|
input_osc_4(struct input_ctx *ictx, const char *p)
|
||||||
@ -2497,17 +2515,22 @@ bad:
|
|||||||
free(copy);
|
free(copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle the OSC 10 sequence for setting foreground colour. */
|
/* Handle the OSC 10 sequence for setting and querying foreground colour. */
|
||||||
static void
|
static void
|
||||||
input_osc_10(struct input_ctx *ictx, const char *p)
|
input_osc_10(struct input_ctx *ictx, const char *p)
|
||||||
{
|
{
|
||||||
struct window_pane *wp = ictx->wp;
|
struct window_pane *wp = ictx->wp;
|
||||||
|
struct grid_cell defaults;
|
||||||
u_int r, g, b;
|
u_int r, g, b;
|
||||||
|
|
||||||
if (wp == NULL)
|
if (wp == NULL)
|
||||||
return;
|
return;
|
||||||
if (strcmp(p, "?") == 0)
|
|
||||||
|
if (strcmp(p, "?") == 0) {
|
||||||
|
tty_default_colours(&defaults, wp);
|
||||||
|
input_osc_colour_reply(ictx, 10, defaults.fg);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!input_osc_parse_colour(p, &r, &g, &b))
|
if (!input_osc_parse_colour(p, &r, &g, &b))
|
||||||
goto bad;
|
goto bad;
|
||||||
@ -2520,17 +2543,22 @@ bad:
|
|||||||
log_debug("bad OSC 10: %s", p);
|
log_debug("bad OSC 10: %s", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle the OSC 11 sequence for setting background colour. */
|
/* Handle the OSC 11 sequence for setting and querying background colour. */
|
||||||
static void
|
static void
|
||||||
input_osc_11(struct input_ctx *ictx, const char *p)
|
input_osc_11(struct input_ctx *ictx, const char *p)
|
||||||
{
|
{
|
||||||
struct window_pane *wp = ictx->wp;
|
struct window_pane *wp = ictx->wp;
|
||||||
|
struct grid_cell defaults;
|
||||||
u_int r, g, b;
|
u_int r, g, b;
|
||||||
|
|
||||||
if (wp == NULL)
|
if (wp == NULL)
|
||||||
return;
|
return;
|
||||||
if (strcmp(p, "?") == 0)
|
|
||||||
|
if (strcmp(p, "?") == 0) {
|
||||||
|
tty_default_colours(&defaults, wp);
|
||||||
|
input_osc_colour_reply(ictx, 11, defaults.bg);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!input_osc_parse_colour(p, &r, &g, &b))
|
if (!input_osc_parse_colour(p, &r, &g, &b))
|
||||||
goto bad;
|
goto bad;
|
||||||
|
Loading…
Reference in New Issue
Block a user