@@ -609,8 +609,7 @@ static bool is_key(unsigned char *key, size_t len, char *key_description) {
609609 memcmp (key , key_description , len ) == 0 );
610610}
611611
612- static void term_set_title (Term * term , char * title ) {
613- size_t len = strlen (title );
612+ static void term_set_title (Term * term , const char * title , size_t len ) {
614613 if (term -> title ) {
615614 free (term -> title );
616615 }
@@ -640,7 +639,11 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *user_data) {
640639
641640 break ;
642641 case VTERM_PROP_TITLE :
643- term_set_title (term , val -> string );
642+ #ifdef VTermStringFragmentNotExists
643+ term_set_title (term , val -> string , strlen (val -> string ));
644+ #else
645+ term_set_title (term , val -> string .str , val -> string .len );
646+ #endif
644647 break ;
645648 case VTERM_PROP_ALTSCREEN :
646649 invalidate_terminal (term , 0 , term -> height );
@@ -923,8 +926,13 @@ void term_finalize(void *object) {
923926 vterm_free (term -> vt );
924927 free (term );
925928}
926-
929+ #ifdef VTermStringFragmentNotExists
927930static int osc_callback (const char * command , size_t cmdlen , void * user ) {
931+ #else
932+ static int osc_callback (int cmd , VTermStringFragment frag , void * user ) {
933+ const char * command = frag .str ;
934+ size_t cmdlen = frag .len ;
935+ #endif
928936 /* osc_callback (OSC = Operating System Command) */
929937
930938 /* We interpret escape codes that start with "51;" */
@@ -976,6 +984,7 @@ static int osc_callback(const char *command, size_t cmdlen, void *user) {
976984 return 0 ;
977985}
978986
987+ #ifdef VTermStringFragmentNotExists
979988static VTermParserCallbacks parser_callbacks = {
980989 .text = NULL ,
981990 .control = NULL ,
@@ -984,6 +993,14 @@ static VTermParserCallbacks parser_callbacks = {
984993 .osc = & osc_callback ,
985994 .dcs = NULL ,
986995};
996+ #else
997+ static VTermStateFallbacks parser_callbacks = {
998+ .control = NULL ,
999+ .csi = NULL ,
1000+ .osc = & osc_callback ,
1001+ .dcs = NULL ,
1002+ };
1003+ #endif
9871004
9881005emacs_value Fvterm_new (emacs_env * env , ptrdiff_t nargs , emacs_value args [],
9891006 void * data ) {
0 commit comments