add window title change feature

This commit is contained in:
cy384 2020-08-29 22:17:01 -04:00
parent 2bb8ac431f
commit 849b9eb573
2 changed files with 25 additions and 3 deletions

View File

@ -237,12 +237,34 @@ int damage(VTermRect rect, void *user)
return 1;
}
int settermprop(VTermProp prop, VTermValue *val, void *user)
{
switch (prop)
{
case VTERM_PROP_TITLE: // string
set_window_title(con.win, val->string);
return 1;
// TODO: handle more of these, particularly cursor visible and blink
case VTERM_PROP_ICONNAME: // string
case VTERM_PROP_REVERSE: //bool
case VTERM_PROP_CURSORSHAPE: // number
case VTERM_PROP_MOUSE: // number
case VTERM_PROP_CURSORVISIBLE: // bool
case VTERM_PROP_CURSORBLINK: // bool
case VTERM_PROP_ALTSCREEN: // bool
default:
break;
}
return 0;
}
const VTermScreenCallbacks vtscrcb =
{
.damage = damage,
.moverect = NULL,
.movecursor = movecursor,
.settermprop = NULL,
.settermprop = settermprop,
.bell = bell,
.resize = NULL,
.sb_pushline = NULL,

View File

@ -23,8 +23,8 @@
#define SSHEVEN_BUFFER_SIZE 4096
/* terminal type to send over ssh, determines features etc.
* "vanilla" supports basically nothing, "vt100" as per the... vt100 */
#define SSHEVEN_TERMINAL_TYPE "vt100"
* "vanilla" supports basically nothing, "vt100" basics, "xterm" everything */
#define SSHEVEN_TERMINAL_TYPE "xterm"
/* dialog for getting connection info */
#define DLOG_CONNECT 128