patch 8.2.0803: libvterm code lags behind the upstream version

Problem:    Libvterm code lags behind the upstream version.
Solution:   Include revisions 764 - 767
diff --git a/src/Makefile b/src/Makefile
index ad8f241..9b50eca 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3562,7 +3562,7 @@
 objects/vterm_state.o: libvterm/src/state.c $(TERM_DEPS)
 	$(CCCTERM) -o $@ libvterm/src/state.c
 
-objects/vterm_unicode.o: libvterm/src/unicode.c $(TERM_DEPS)
+objects/vterm_unicode.o: libvterm/src/unicode.c $(TERM_DEPS) libvterm/src/fullwidth.inc
 	$(CCCTERM) -o $@ libvterm/src/unicode.c
 
 objects/vterm_vterm.o: libvterm/src/vterm.c $(TERM_DEPS)
diff --git a/src/libvterm/find-wide-chars.pl b/src/libvterm/find-wide-chars.pl
index fc4a234..f7f2205 100644
--- a/src/libvterm/find-wide-chars.pl
+++ b/src/libvterm/find-wide-chars.pl
@@ -3,16 +3,12 @@
 use strict;
 use warnings;
 
-use Unicode::UCD qw( charprop );
-
 STDOUT->autoflush(1);
 
 sub iswide
 {
    my ( $cp ) = @_;
-
-   my $width = charprop( $cp, "East_Asian_Width" ) or return;
-   return $width eq "Wide" || $width eq "Fullwidth";
+   return chr($cp) =~ m/\p{East_Asian_Width=Wide}|\p{East_Asian_Width=Fullwidth}/;
 }
 
 my ( $start, $end );
diff --git a/src/libvterm/src/fullwidth.inc b/src/libvterm/src/fullwidth.inc
index 7ff142f..a703529 100644
--- a/src/libvterm/src/fullwidth.inc
+++ b/src/libvterm/src/fullwidth.inc
@@ -40,14 +40,13 @@
   { 0x3000, 0x303e },
   { 0x3041, 0x3096 },
   { 0x3099, 0x30ff },
-  { 0x3105, 0x312d },
+  { 0x3105, 0x312f },
   { 0x3131, 0x318e },
   { 0x3190, 0x31ba },
   { 0x31c0, 0x31e3 },
   { 0x31f0, 0x321e },
   { 0x3220, 0x3247 },
-  { 0x3250, 0x32fe },
-  { 0x3300, 0x4dbf },
+  { 0x3250, 0x4dbf },
   { 0x4e00, 0xa48c },
   { 0xa490, 0xa4c6 },
   { 0xa960, 0xa97c },
@@ -59,10 +58,13 @@
   { 0xfe68, 0xfe6b },
   { 0xff01, 0xff60 },
   { 0xffe0, 0xffe6 },
-  { 0x16fe0, 0x16fe0 },
-  { 0x17000, 0x187ec },
+  { 0x16fe0, 0x16fe3 },
+  { 0x17000, 0x187f7 },
   { 0x18800, 0x18af2 },
-  { 0x1b000, 0x1b001 },
+  { 0x1b000, 0x1b11e },
+  { 0x1b150, 0x1b152 },
+  { 0x1b164, 0x1b167 },
+  { 0x1b170, 0x1b2fb },
   { 0x1f004, 0x1f004 },
   { 0x1f0cf, 0x1f0cf },
   { 0x1f18e, 0x1f18e },
@@ -71,6 +73,7 @@
   { 0x1f210, 0x1f23b },
   { 0x1f240, 0x1f248 },
   { 0x1f250, 0x1f251 },
+  { 0x1f260, 0x1f265 },
   { 0x1f300, 0x1f320 },
   { 0x1f32d, 0x1f335 },
   { 0x1f337, 0x1f37c },
@@ -92,13 +95,17 @@
   { 0x1f680, 0x1f6c5 },
   { 0x1f6cc, 0x1f6cc },
   { 0x1f6d0, 0x1f6d2 },
+  { 0x1f6d5, 0x1f6d5 },
   { 0x1f6eb, 0x1f6ec },
-  { 0x1f6f4, 0x1f6f6 },
-  { 0x1f910, 0x1f91e },
-  { 0x1f920, 0x1f927 },
-  { 0x1f930, 0x1f930 },
-  { 0x1f933, 0x1f93e },
-  { 0x1f940, 0x1f94b },
-  { 0x1f950, 0x1f95e },
-  { 0x1f980, 0x1f991 },
-  { 0x1f9c0, 0x1f9c0 },
+  { 0x1f6f4, 0x1f6fa },
+  { 0x1f7e0, 0x1f7eb },
+  { 0x1f90d, 0x1f971 },
+  { 0x1f973, 0x1f976 },
+  { 0x1f97a, 0x1f9a2 },
+  { 0x1f9a5, 0x1f9aa },
+  { 0x1f9ae, 0x1f9ca },
+  { 0x1f9cd, 0x1f9ff },
+  { 0x1fa70, 0x1fa73 },
+  { 0x1fa78, 0x1fa7a },
+  { 0x1fa80, 0x1fa82 },
+  { 0x1fa90, 0x1fa95 },
diff --git a/src/libvterm/src/parser.c b/src/libvterm/src/parser.c
index 520ec2c..fef5bd3 100644
--- a/src/libvterm/src/parser.c
+++ b/src/libvterm/src/parser.c
@@ -119,13 +119,15 @@
 #define ENTER_STATE(st)        do { vt->parser.state = st; string_start = NULL; } while(0)
 #define ENTER_NORMAL_STATE()   ENTER_STATE(NORMAL)
 
+#define IS_STRING_STATE()      (vt->parser.state >= OSC_COMMAND)
+
   for( ; pos < len; pos++) {
     unsigned char c = bytes[pos];
     int c1_allowed = !vt->mode.utf8;
     size_t string_len;
 
     if(c == 0x00 || c == 0x7f) { // NUL, DEL
-      if(vt->parser.state >= OSC) {
+      if(IS_STRING_STATE()) {
         string_fragment(vt, string_start, bytes + pos - string_start, FALSE);
         string_start = bytes + pos + 1;
       }
@@ -138,13 +140,13 @@
     }
     else if(c == 0x1b) { // ESC
       vt->parser.intermedlen = 0;
-      if(vt->parser.state < OSC)
+      if(!IS_STRING_STATE())
         vt->parser.state = NORMAL;
       vt->parser.in_esc = TRUE;
       continue;
     }
     else if(c == 0x07 &&  // BEL, can stand for ST in OSC or DCS state
-            vt->parser.state >= OSC) {
+            IS_STRING_STATE()) {
       // fallthrough
     }
     else if(c < 0x20) { // other C0
@@ -155,10 +157,10 @@
           if(pos + 2 < len && bytes[pos + 1] == 0x20 && bytes[pos + 2] == 0x08)
             vt->in_backspace = 2; // Trigger when count down to 1
       }
-      if(vt->parser.state >= OSC)
+      if(IS_STRING_STATE())
         string_fragment(vt, string_start, bytes + pos - string_start, FALSE);
       do_control(vt, c);
-      if(vt->parser.state >= OSC)
+      if(IS_STRING_STATE())
         string_start = bytes + pos + 1;
       continue;
     }
@@ -171,7 +173,7 @@
       // Always accept ESC \ == ST even in string mode
       if(!vt->parser.intermedlen &&
           c >= 0x40 && c < 0x60 &&
-          ((vt->parser.state < OSC || c == 0x5c))) {
+          ((!IS_STRING_STATE() || c == 0x5c))) {
         c += 0x40;
         c1_allowed = TRUE;
         string_len -= 1;
@@ -260,6 +262,7 @@
 
       /* else fallthrough */
       string_start = bytes + pos;
+      string_len   = 0;
       vt->parser.state = OSC;
       goto string_state;
 
@@ -312,6 +315,7 @@
         case 0x9d: // OSC
           vt->parser.v.osc.command = -1;
           vt->parser.string_initial = TRUE;
+          string_start = bytes + pos + 1;
           ENTER_STATE(OSC_COMMAND);
           break;
         default:
diff --git a/src/libvterm/src/vterm_internal.h b/src/libvterm/src/vterm_internal.h
index 1cfe938..a65e576 100644
--- a/src/libvterm/src/vterm_internal.h
+++ b/src/libvterm/src/vterm_internal.h
@@ -187,9 +187,9 @@
       CSI_LEADER,
       CSI_ARGS,
       CSI_INTERMED,
-      OSC_COMMAND,
       DCS_COMMAND,
-      // below here are the "string states"
+      /* below here are the "string states" */
+      OSC_COMMAND,
       OSC,
       DCS,
     } state;
diff --git a/src/libvterm/t/02parser.test b/src/libvterm/t/02parser.test
index 4a4a65b..0a21b92 100644
--- a/src/libvterm/t/02parser.test
+++ b/src/libvterm/t/02parser.test
@@ -150,6 +150,14 @@
 PUSH "ghi\e\\"
   osc "ghi"]
 
+!OSC BEL without semicolon 
+PUSH "\e]1234\x07"
+  osc [1234 ]
+
+!OSC ST without semicolon 
+PUSH "\e]1234\e\\"
+  osc [1234 ]
+
 !Escape cancels OSC, starts Escape
 PUSH "\e]Something\e9"
   escape "9"
diff --git a/src/libvterm/t/run-test.pl b/src/libvterm/t/run-test.pl
index 9f48c5c..96f47fb 100644
--- a/src/libvterm/t/run-test.pl
+++ b/src/libvterm/t/run-test.pl
@@ -112,7 +112,7 @@
          $initial //= "";
          $initial .= ";" if $initial =~ m/\d+/;
 
-         $line = "$cmd $initial" . join( "", map sprintf("%02x", $_), unpack "C*", eval($data) ) . "$final";
+         $line = "$cmd $initial" . join( "", map sprintf("%02x", $_), unpack "C*", length $data ? eval($data) : "" ) . "$final";
       }
       elsif( $line =~ m/^(escape|dcs) (\[?)(.*?)(\]?)$/ ) {
          $line = "$1 $2" . join( "", map sprintf("%02x", $_), unpack "C*", eval($3) ) . "$4";
diff --git a/src/version.c b/src/version.c
index ab899f3..31aa395 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    803,
+/**/
     802,
 /**/
     801,