term: track current window title in terminal struct

This commit is contained in:
Daniel Eklöf 2019-07-21 17:35:53 +02:00
parent 326808f94d
commit 97350f6488
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 17 additions and 4 deletions

View file

@ -10,6 +10,7 @@
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "grid.h"
#include "render.h"
#include "vt.h"
#define min(x, y) ((x) < (y) ? (x) : (y))
@ -460,3 +461,11 @@ term_mouse_motion(struct terminal *term, int button, int row, int col,
break;
}
}
void
term_set_window_title(struct terminal *term, const char *title)
{
free(term->window_title);
term->window_title = strdup(title);
render_set_title(term, term->window_title);
}