aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-12-07 09:52:59 +0000
committerThomas Adam <thomas@xteddy.org>2021-12-07 09:52:59 +0000
commit138ffc7cb6225b8a6d54d771b0112635f0dbb42e (patch)
tree289b9f8c4ca207f92b6d81f9511c520969241120 /input.c
parentef676e1202a4d5c423d5bba2f8ecba1f768d8364 (diff)
parentd721fb2a9fd70c157abb8540d4c50fca654f9f4d (diff)
downloadrtmux-138ffc7cb6225b8a6d54d771b0112635f0dbb42e.tar.gz
rtmux-138ffc7cb6225b8a6d54d771b0112635f0dbb42e.tar.bz2
rtmux-138ffc7cb6225b8a6d54d771b0112635f0dbb42e.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'input.c')
-rw-r--r--input.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/input.c b/input.c
index 3626c4b2..16f31ad7 100644
--- a/input.c
+++ b/input.c
@@ -2382,6 +2382,7 @@ static void
input_exit_rename(struct input_ctx *ictx)
{
struct window_pane *wp = ictx->wp;
+ struct window *w;
struct options_entry *o;
if (wp == NULL)
@@ -2394,17 +2395,20 @@ input_exit_rename(struct input_ctx *ictx)
if (!utf8_isvalid(ictx->input_buf))
return;
+ w = wp->window;
if (ictx->input_len == 0) {
- o = options_get_only(wp->window->options, "automatic-rename");
+ o = options_get_only(w->options, "automatic-rename");
if (o != NULL)
options_remove_or_default(o, -1, NULL);
- return;
+ if (!options_get_number(w->options, "automatic-rename"))
+ window_set_name(w, "");
+ } else {
+ options_set_number(w->options, "automatic-rename", 0);
+ window_set_name(w, ictx->input_buf);
}
- window_set_name(wp->window, ictx->input_buf);
- options_set_number(wp->window->options, "automatic-rename", 0);
- server_redraw_window_borders(wp->window);
- server_status_window(wp->window);
+ server_redraw_window_borders(w);
+ server_status_window(w);
}
/* Open UTF-8 character. */
@@ -2501,7 +2505,8 @@ input_osc_colour_reply(struct input_ctx *ictx, u_int n, int c)
end = "\007";
else
end = "\033\\";
- input_reply(ictx, "\033]%u;rgb:%02hhx/%02hhx/%02hhx%s", n, r, g, b, end);
+ input_reply(ictx, "\033]%u;rgb:%02hhx%02hhx/%02hhx%02hhx/%02hhx%02hhx%s",
+ n, r, r, g, g, b, b, end);
}
/* Handle the OSC 4 sequence for setting (multiple) palette entries. */
@@ -2525,6 +2530,12 @@ input_osc_4(struct input_ctx *ictx, const char *p)
}
s = strsep(&next, ";");
+ if (strcmp(s, "?") == 0) {
+ c = colour_palette_get(ictx->palette, idx);
+ if (c != -1)
+ input_osc_colour_reply(ictx, 4, c);
+ continue;
+ }
if ((c = input_osc_parse_colour(s)) == -1) {
s = next;
continue;