Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libvterm for openSUSE:Factory checked in at 2023-01-21 19:10:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libvterm (Old) and /work/SRC/openSUSE:Factory/.libvterm.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvterm" Sat Jan 21 19:10:52 2023 rev:10 rq:1060042 version:0.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libvterm/libvterm.changes 2022-10-04 20:37:39.716910854 +0200 +++ /work/SRC/openSUSE:Factory/.libvterm.new.32243/libvterm.changes 2023-01-21 19:11:16.141198375 +0100 @@ -1,0 +2,12 @@ +Fri Jan 20 16:27:01 UTC 2023 - Dirk Müller <[email protected]> + +- update to 0.3.1: + * vterm-dump specifically emit NUL/CAN/SUB/DEL + * Optionally emit NUL/CAN/SUB/DEL from parser than + * Don't bother to emit the unrecognized sequence in DECRQSS + * erase_internal should only set fg/bg color, resetting others + * Added vterm_screen_set_default_colors() + * Delete mk_wcswidth functions as they're unused + * Also accept DECSGR sequences for superscript/subscript + +------------------------------------------------------------------- Old: ---- libvterm-0.3.tar.gz New: ---- libvterm-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvterm.spec ++++++ --- /var/tmp/diff_new_pack.SqeGwl/_old 2023-01-21 19:11:16.569200818 +0100 +++ /var/tmp/diff_new_pack.SqeGwl/_new 2023-01-21 19:11:16.573200841 +0100 @@ -1,7 +1,7 @@ # # spec file for package libvterm # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %{?!_make_verbose:%define _make_verbose V=1 VERBOSE=1} Name: libvterm -Version: 0.3 +Version: 0.3.1 Release: 0 Summary: An abstract library implementation of a VT220/xterm/ECMA-48 terminal emulator License: MIT ++++++ libvterm-0.3.tar.gz -> libvterm-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/Makefile new/libvterm-0.3.1/Makefile --- old/libvterm-0.3/Makefile 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/Makefile 2023-01-15 23:21:59.000000000 +0100 @@ -36,14 +36,11 @@ HFILES_INT=$(sort $(wildcard src/*.h)) $(HFILES) -VERSION_MAJOR=0 -VERSION_MINOR=3 - VERSION_CURRENT=0 VERSION_REVISION=0 VERSION_AGE=0 -VERSION=$(VERSION_MAJOR).$(VERSION_MINOR) +VERSION=0.3.1 PREFIX=/usr/local BINDIR=$(PREFIX)/bin @@ -111,35 +108,3 @@ install -d $(DESTDIR)$(BINDIR) $(LIBTOOL) --mode=install install $(BINFILES) $(DESTDIR)$(BINDIR)/ -# DIST CUT - -DISTDIR=libvterm-$(VERSION) - -distdir: $(INCFILES) - mkdir __distdir - cp LICENSE CONTRIBUTING __distdir - mkdir __distdir/src - cp src/*.c src/*.h src/*.inc __distdir/src - mkdir __distdir/src/encoding - cp src/encoding/*.inc __distdir/src/encoding - mkdir __distdir/include - cp include/*.h __distdir/include - mkdir __distdir/bin - cp bin/*.c __distdir/bin - mkdir __distdir/t - cp t/*.test t/harness.c t/run-test.pl __distdir/t - sed "s,@VERSION@,$(VERSION)," <vterm.pc.in >__distdir/vterm.pc.in - sed "/^# DIST CUT/Q" <Makefile >__distdir/Makefile - mv __distdir $(DISTDIR) - -TARBALL=$(DISTDIR).tar.gz - -dist: distdir - tar -czf $(TARBALL) $(DISTDIR) - rm -rf $(DISTDIR) - -dist+bzr: - $(MAKE) dist VERSION=$(VERSION)+bzr`bzr revno` - -distdir+bzr: - $(MAKE) distdir VERSION=$(VERSION)+bzr`bzr revno` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/bin/vterm-ctrl.c new/libvterm-0.3.1/bin/vterm-ctrl.c --- old/libvterm-0.3/bin/vterm-ctrl.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/bin/vterm-ctrl.c 2023-01-15 23:21:59.000000000 +0100 @@ -97,7 +97,7 @@ } } -static char *read_csi() +static char *read_csi(void) { await_c1(0x9B); // CSI @@ -117,7 +117,7 @@ return strdup(csi); } -static char *read_dcs() +static char *read_dcs(void) { await_c1(0x90); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/bin/vterm-dump.c new/libvterm-0.3.1/bin/vterm-dump.c --- old/libvterm-0.3/bin/vterm-dump.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/bin/vterm-dump.c 2023-01-15 23:21:59.000000000 +0100 @@ -65,6 +65,8 @@ { if(control < 0x20) printf("%s%s%s", special_begin, name_c0[control], special_end); + else if(control == 0x7f) + printf("%s%s%s", special_begin, "DEL", special_end); else if(control >= 0x80 && control < 0xa0 && name_c1[control - 0x80]) printf("%s%s%s", special_begin, name_c1[control - 0x80], special_end); else @@ -226,6 +228,7 @@ VTerm *vt = vterm_new(25, 80); vterm_set_utf8(vt, 1); vterm_parser_set_callbacks(vt, &parser_cbs, NULL); + vterm_parser_set_emit_nul(vt, true); int len; char buffer[1024]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/doc/URLs new/libvterm-0.3.1/doc/URLs --- old/libvterm-0.3/doc/URLs 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/doc/URLs 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +0,0 @@ -ECMA-48: - http://www.ecma-international.org/publications/standards/Ecma-048.htm - -Xterm Control Sequences: - http://invisible-island.net/xterm/ctlseqs/ctlseqs.html - -Digital VT100 User Guide: - http://vt100.net/docs/vt100-ug/ - -Digital VT220 Programmer Reference Manual - http://vt100.net/docs/vt220-rm/ - -Summary of ANSI standards for ASCII terminals - http://www.inwap.com/pdp10/ansicode.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/doc/seqs.txt new/libvterm-0.3.1/doc/seqs.txt --- old/libvterm-0.3/doc/seqs.txt 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/doc/seqs.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,283 +0,0 @@ -Sequences documented in parens are implicit ones from parser.c, which move -between states. - -1 = VT100 -2 = VT220 -3 = VT320 -x = xterm - - C0 controls - -123 0x00 = NUL -123x 0x07 = BEL -123x 0x08 = BS -123x 0x09 = HT -123x 0x0A = LF -123x 0x0B = VT -123x 0x0C = FF -123x 0x0D = CR -123x 0x0E = LS1 -123x 0x0F = LS0 - (0x18 = CAN) - (0x1A = SUB) - (0x1B = ESC) - -123 0x7f = DEL (ignored) - - C1 controls - -123x 0x84 = IND -123x 0x85 = NEL -123x 0x88 = HTS -123x 0x8D = RI - 23x 0x8E = SS2 - 23x 0x8F = SS3 - (0x90 = DCS) - (0x98 = SOS) - (0x9B = CSI) - (0x9C = ST) - (0x9D = OSC) - (0x9E = PM) - (0x9F = APC) - - Escape sequences - - excluding sequences that are C1 aliases - -123x ESC ( = SCS, select character set G0 -123x ESC ) = SCS, select character set G1 - 23x ESC * = SCS, select character set G2 - 23x ESC + = SCS, select character set G3 -123x ESC 7 = DECSC - save cursor -123x ESC 8 = DECRC - restore cursor -123x ESC # 3 = DECDHL, double-height line (top half) -123x ESC # 4 = DECDHL, double-height line (bottom half) -123x ESC # 5 = DECSWL, single-width single-height line -123x ESC # 6 = DECDWL, double-width single-height line -123x ESC # 8 = DECALN -123 ESC < = Ignored (used by VT100 to exit VT52 mode) -123x ESC = = DECKPAM, keypad application mode -123x ESC > = DECKPNM, keypad numeric mode - 23x ESC Sp F = S7C1T - 23x ESC Sp G = S8C1T - (ESC P = DCS) - (ESC X = SOS) - (ESC [ = CSI) - (ESC \ = ST) - (ESC ] = OSC) - (ESC ^ = PM) - (ESC _ = APC) -123x ESC c = RIS, reset initial state - 3x ESC n = LS2 - 3x ESC o = LS3 - 3x ESC | = LS3R - 3x ESC } = LS2R - 3x ESC ~ = LS1R - - DCSes - - 3x DCS $ q ST = DECRQSS - 3x m = Request SGR - x Sp q = Request DECSCUSR - 3x " q = Request DECSCA - 3x r = Request DECSTBM - x s = Request DECSLRM - - CSIs - 23x CSI @ = ICH -123x CSI A = CUU -123x CSI B = CUD -123x CSI C = CUF -123x CSI D = CUB - x CSI E = CNL - x CSI F = CPL - x CSI G = CHA -123x CSI H = CUP - x CSI I = CHT -123x CSI J = ED - 23x CSI ? J = DECSED, selective erase in display -123x CSI K = EL - 23x CSI ? K = DECSEL, selective erase in line - 23x CSI L = IL - 23x CSI M = DL - 23x CSI P = DCH - x CSI S = SU - x CSI T = SD - 23x CSI X = ECH - x CSI Z = CBT - x CSI ` = HPA - x CSI a = HPR - x CSI b = REP -123x CSI c = DA, device attributes -123 0 = DA - 23x CSI > c = DECSDA - 23 0 = SDA - x CSI d = VPA - x CSI e = VPR -123x CSI f = HVP -123x CSI g = TBC -123x CSI h = SM, Set mode -123x CSI ? h = DECSM, DEC set mode - CSI j = HPB - CSI k = VPB -123x CSI l = RM, Reset mode -123x CSI ? l = DECRM, DEC reset mode -123x CSI m = SGR, Set Graphic Rendition - CSI ? m = DECSGR, private Set Graphic Rendition -123x CSI n = DSR, Device Status Report - 23x 5 = operating status - 23x 6 = CPR = cursor position - 23x CSI ? n = DECDSR; behaves as DSR but uses CSI ? instead of CSI to respond - 23x CSI ! p = DECSTR, soft terminal reset - 3x CSI ? $ p = DECRQM, request private mode - x CSI Sp q = DECSCUSR (odd numbers blink, even numbers solid) - 1 or 2 = block - 3 or 4 = underline - 5 or 6 = I-beam to left - x CSI > q = XTVERSION, request version string - 23x CSI " q = DECSCA, select character attributes -123x CSI r = DECSTBM - x CSI s = DECSLRM - x CSI ' } = DECIC - x CSI ' ~ = DECDC - - OSCs - - x OSC 0; = Set icon name and title - x OSC 1; = Set icon name - x OSC 2; = Set title - x OSC 52; = Selection management - - Standard modes - - 23x SM 4 = IRM -123x SM 20 = NLM, linefeed/newline - - DEC modes - -123x DECSM 1 = DECCKM, cursor keys -123x DECSM 5 = DECSCNM, screen -123x DECSM 6 = DECOM, origin -123x DECSM 7 = DECAWM, autowrap - x DECSM 12 = Cursor blink - 23x DECSM 25 = DECTCEM, text cursor enable - x DECSM 69 = DECVSSM, vertical screen split - x DECSM 1000 = Mouse click/release tracking - x DECSM 1002 = Mouse click/release/drag tracking - x DECSM 1003 = Mouse all movements tracking - x DECSM 1004 = Focus in/out reporting - x DECSM 1005 = Mouse protocol extended (UTF-8) - not recommended - x DECSM 1006 = Mouse protocol SGR - x DECSM 1015 = Mouse protocol rxvt - x DECSM 1047 = Altscreen - x DECSM 1048 = Save cursor - x DECSM 1049 = 1047 + 1048 - x DECSM 2004 = Bracketed paste - - Graphic Renditions - -123x SGR 0 = Reset -123x SGR 1 = Bold on - x SGR 3 = Italic on -123x SGR 4 = Underline single - SGR 4:x = Underline style -123x SGR 5 = Blink on -123x SGR 7 = Reverse on - x SGR 8 = Conceal on - x SGR 9 = Strikethrough on - SGR 10-19 = Select font - x SGR 21 = Underline double - 23x SGR 22 = Bold off - x SGR 23 = Italic off - 23x SGR 24 = Underline off - 23x SGR 25 = Blink off - 23x SGR 27 = Reverse off - x SGR 28 = Conceal off - x SGR 29 = Strikethrough off - x SGR 30-37 = Foreground ANSI - x SGR 38 = Foreground alternative palette - x SGR 39 = Foreground default - x SGR 40-47 = Background ANSI - x SGR 48 = Background alternative palette - x SGR 49 = Background default - SGR 73 = Superscript on - SGR 74 = Subscript on - SGR 75 = Superscript/subscript off - x SGR 90-97 = Foreground ANSI high-intensity - x SGR 100-107 = Background ANSI high-intensity - -The state storage used by ESC 7 and DECSM 1048/1049 is shared. - - Unimplemented sequences: - -The following sequences are not recognised by libvterm. - -123x 0x05 = ENQ - 3 0x11 = DC1 (XON) - 3 0x13 = DC3 (XOFF) - x ESC % @ = Select default character set - x ESC % G = Select UTF-8 character set - x ESC 6 = DECBI, Back Index -12 ESC Z = DECID, identify terminal - x DCS + Q = XTGETXRES, Request resource values - DCS $ q = [DECRQSS] - 3x " p = Request DECSCL - x t = Request DECSLPP - x $ | = Request DECSCPP - x * | = Request DECSLNS - 3 $ } = Request DECSASD - 3 $ ~ = Request DECSSDT - x DCS + p = XTSETTCAP, set termcap/terminfo data - x DCS + q = XTGETTCAP, request termcap/terminfo - 23 DCS { = DECDLD, down-line-loadable character set - 23x DCS | = DECUDK, user-defined key - x CSI Sp @ = Shift left columns - x CSI Sp A = Shift right columns - x CSI # P = XTPUSHCOLORS, push current dynamic colours to stack - x CSI # Q = XTPOPCOLORS, pop dynamic colours from stack - x CSI # R = XTREPORTCOLORS, report current entry on palette stack - x CSI ? S = XTSMGRAPHICS, set/request graphics attribute - x CSI > T = XTRMTITLE, reset title mode features - 23x CSI i = DEC printer control - x CSI > m = XTMODKEYS, set key modifier options - x CSI > n = (XTMODKEYS), reset key modifier options - x CSI $ p = DECRQM, request ANSI mode - 23x CSI " p = DECSCL, set compatibility level - x CSI > p = XTSMPOINTER, set resource value pointer mode -1 x CSI q = DECLL, load LEDs - x CSI ? r = XTRESTORE, restore DEC private mode values - x CSI $ r = DECCARA, change attributes in rectangular area - x CSI > s = XTSHIFTESCAPE, set/reset shift-escape options - x CSI ? s = XTSAVE, save DEC private mode values - x CSI t = XTWINOPS, window operations - x CSI > t = XTSMTITLE, set title mode features - x CSI $ t = DECRARA, reset attributes in rectangular area - 3 CSI $ u = DECRQTSR, request terminal state report - 3 1 = terminal state report - 3 CSI & u = DECRQUPSS, request user-preferred supplemental set - x CSI $ v = DECCRA, copy rectangular area - 3x CSI $ w = DECRQPSR, request presentation state report - 3x 1 = cursor information report - 3x 2 = tab stop report - x CSI ' w = DECEFR, enable filter rectangle -1 x CSI x = DECREQTPARM, request terminal parameters - x CSI * x = DECSACE, select attribute change extent - x CSI $ x = DECFRA, fill rectangular area -123 CSI y = DECTST, invoke confidence test - x CSI $ z = DECERA, erase rectangular area - x CSI # { = XTPUSHSGR, push video attributes onto stack - x CSI $ { = DECSERA, selective erase in rectangular area - x CSI # | = XTREPORTSGR, report selected graphic rendition - x CSI $ | = DECSCPP, select columns per page - x CSI # } = XTPOPSGR, pop video attributes from stack - 3 CSI $ } = DECSASD, select active status display - 3 CSI $ ~ = DECSSDT, select status line type - 23 SM 2 = KAM, keyboard action -123 SM 12 = SRM, send/receive -123 DECSM 2 = DECANM, ANSI/VT52 -123 DECSM 3 = DECCOLM, 132 column -123 DECSM 4 = DECSCLM, scrolling -123 DECSM 8 = DECARM, auto-repeat -12 DECSM 9 = DECINLM, interlace - 23 DECSM 18 = DECPFF, print form feed - 23 DECSM 19 = DECPEX, print extent - 23 DECSM 42 = DECNRCM, national/multinational character diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/find-wide-chars.pl new/libvterm-0.3.1/find-wide-chars.pl --- old/libvterm-0.3/find-wide-chars.pl 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/find-wide-chars.pl 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -STDOUT->autoflush(1); - -sub iswide -{ - my ( $cp ) = @_; - return chr($cp) =~ m/\p{East_Asian_Width=Wide}|\p{East_Asian_Width=Fullwidth}/; -} - -my ( $start, $end ); -foreach my $cp ( 0 .. 0x1FFFF ) { - iswide($cp) or next; - - if( defined $end and $end == $cp-1 ) { - # extend the range - $end = $cp; - next; - } - - # start a new range - printf " { %#04x, %#04x },\n", $start, $end if defined $start; - - $start = $end = $cp; -} - -printf " { %#04x, %#04x },\n", $start, $end if defined $start; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/include/vterm.h new/libvterm-0.3.1/include/vterm.h --- old/libvterm-0.3/include/vterm.h 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/include/vterm.h 2023-01-15 23:21:59.000000000 +0100 @@ -413,6 +413,11 @@ void vterm_parser_set_callbacks(VTerm *vt, const VTermParserCallbacks *callbacks, void *user); void *vterm_parser_get_cbdata(VTerm *vt); +/* Normally NUL, CAN, SUB and DEL are ignored. Setting this true causes them + * to be emitted by the 'control' callback + */ +void vterm_parser_set_emit_nul(VTerm *vt, bool emit); + // ----------- // State layer // ----------- @@ -598,6 +603,12 @@ */ void vterm_screen_convert_color_to_rgb(const VTermScreen *screen, VTermColor *col); +/** + * Similar to vterm_state_set_default_colors(), but also resets colours in the + * screen buffer(s) + */ +void vterm_screen_set_default_colors(VTermScreen *screen, const VTermColor *default_fg, const VTermColor *default_bg); + // --------- // Utilities // --------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/encoding/DECdrawing.inc new/libvterm-0.3.1/src/encoding/DECdrawing.inc --- old/libvterm-0.3/src/encoding/DECdrawing.inc 1970-01-01 01:00:00.000000000 +0100 +++ new/libvterm-0.3.1/src/encoding/DECdrawing.inc 2023-01-15 23:21:59.000000000 +0100 @@ -0,0 +1,36 @@ +static const struct StaticTableEncoding encoding_DECdrawing = { + { .decode = &decode_table }, + { + [0x60] = 0x25C6, + [0x61] = 0x2592, + [0x62] = 0x2409, + [0x63] = 0x240C, + [0x64] = 0x240D, + [0x65] = 0x240A, + [0x66] = 0x00B0, + [0x67] = 0x00B1, + [0x68] = 0x2424, + [0x69] = 0x240B, + [0x6a] = 0x2518, + [0x6b] = 0x2510, + [0x6c] = 0x250C, + [0x6d] = 0x2514, + [0x6e] = 0x253C, + [0x6f] = 0x23BA, + [0x70] = 0x23BB, + [0x71] = 0x2500, + [0x72] = 0x23BC, + [0x73] = 0x23BD, + [0x74] = 0x251C, + [0x75] = 0x2524, + [0x76] = 0x2534, + [0x77] = 0x252C, + [0x78] = 0x2502, + [0x79] = 0x2A7D, + [0x7a] = 0x2A7E, + [0x7b] = 0x03C0, + [0x7c] = 0x2260, + [0x7d] = 0x00A3, + [0x7e] = 0x00B7, + } +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/encoding/DECdrawing.tbl new/libvterm-0.3.1/src/encoding/DECdrawing.tbl --- old/libvterm-0.3/src/encoding/DECdrawing.tbl 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/encoding/DECdrawing.tbl 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -6/0 = U+25C6 # BLACK DIAMOND -6/1 = U+2592 # MEDIUM SHADE (checkerboard) -6/2 = U+2409 # SYMBOL FOR HORIZONTAL TAB -6/3 = U+240C # SYMBOL FOR FORM FEED -6/4 = U+240D # SYMBOL FOR CARRIAGE RETURN -6/5 = U+240A # SYMBOL FOR LINE FEED -6/6 = U+00B0 # DEGREE SIGN -6/7 = U+00B1 # PLUS-MINUS SIGN (plus or minus) -6/8 = U+2424 # SYMBOL FOR NEW LINE -6/9 = U+240B # SYMBOL FOR VERTICAL TAB -6/10 = U+2518 # BOX DRAWINGS LIGHT UP AND LEFT (bottom-right corner) -6/11 = U+2510 # BOX DRAWINGS LIGHT DOWN AND LEFT (top-right corner) -6/12 = U+250C # BOX DRAWINGS LIGHT DOWN AND RIGHT (top-left corner) -6/13 = U+2514 # BOX DRAWINGS LIGHT UP AND RIGHT (bottom-left corner) -6/14 = U+253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL (crossing lines) -6/15 = U+23BA # HORIZONTAL SCAN LINE-1 -7/0 = U+23BB # HORIZONTAL SCAN LINE-3 -7/1 = U+2500 # BOX DRAWINGS LIGHT HORIZONTAL -7/2 = U+23BC # HORIZONTAL SCAN LINE-7 -7/3 = U+23BD # HORIZONTAL SCAN LINE-9 -7/4 = U+251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT -7/5 = U+2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT -7/6 = U+2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL -7/7 = U+252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL -7/8 = U+2502 # BOX DRAWINGS LIGHT VERTICAL -7/9 = U+2A7D # LESS-THAN OR SLANTED EQUAL-TO -7/10 = U+2A7E # GREATER-THAN OR SLANTED EQUAL-TO -7/11 = U+03C0 # GREEK SMALL LETTER PI -7/12 = U+2260 # NOT EQUAL TO -7/13 = U+00A3 # POUND SIGN -7/14 = U+00B7 # MIDDLE DOT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/encoding/uk.inc new/libvterm-0.3.1/src/encoding/uk.inc --- old/libvterm-0.3/src/encoding/uk.inc 1970-01-01 01:00:00.000000000 +0100 +++ new/libvterm-0.3.1/src/encoding/uk.inc 2023-01-15 23:21:59.000000000 +0100 @@ -0,0 +1,6 @@ +static const struct StaticTableEncoding encoding_uk = { + { .decode = &decode_table }, + { + [0x23] = 0x00a3, + } +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/encoding/uk.tbl new/libvterm-0.3.1/src/encoding/uk.tbl --- old/libvterm-0.3/src/encoding/uk.tbl 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/encoding/uk.tbl 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -2/3 = "£" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/parser.c new/libvterm-0.3.1/src/parser.c --- old/libvterm-0.3/src/parser.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/parser.c 2023-01-15 23:21:59.000000000 +0100 @@ -145,11 +145,15 @@ string_fragment(vt, string_start, bytes + pos - string_start, false); string_start = bytes + pos + 1; } + if(vt->parser.emit_nul) + do_control(vt, c); continue; } if(c == 0x18 || c == 0x1a) { // CAN, SUB vt->parser.in_esc = false; ENTER_NORMAL_STATE(); + if(vt->parser.emit_nul) + do_control(vt, c); continue; } else if(c == 0x1b) { // ESC @@ -391,3 +395,8 @@ { return vt->parser.cbdata; } + +void vterm_parser_set_emit_nul(VTerm *vt, bool emit) +{ + vt->parser.emit_nul = emit; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/pen.c new/libvterm-0.3.1/src/pen.c --- old/libvterm-0.3/src/pen.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/pen.c 2023-01-15 23:21:59.000000000 +0100 @@ -241,15 +241,17 @@ void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg) { - /* Copy the given colors */ - state->default_fg = *default_fg; - state->default_bg = *default_bg; + if(default_fg) { + state->default_fg = *default_fg; + state->default_fg.type = (state->default_fg.type & ~VTERM_COLOR_DEFAULT_MASK) + | VTERM_COLOR_DEFAULT_FG; + } - /* Make sure the correct type flags are set */ - state->default_fg.type = (state->default_fg.type & ~VTERM_COLOR_DEFAULT_MASK) - | VTERM_COLOR_DEFAULT_FG; - state->default_bg.type = (state->default_bg.type & ~VTERM_COLOR_DEFAULT_MASK) - | VTERM_COLOR_DEFAULT_BG; + if(default_bg) { + state->default_bg = *default_bg; + state->default_bg.type = (state->default_bg.type & ~VTERM_COLOR_DEFAULT_MASK) + | VTERM_COLOR_DEFAULT_BG; + } } void vterm_state_set_palette_color(VTermState *state, int index, const VTermColor *col) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/screen.c new/libvterm-0.3.1/src/screen.c --- old/libvterm-0.3/src/screen.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/screen.c 2023-01-15 23:21:59.000000000 +0100 @@ -281,7 +281,11 @@ continue; cell->chars[0] = 0; - cell->pen = screen->pen; + cell->pen = (ScreenPen){ + /* Only copy .fg and .bg; leave things like rv in reset state */ + .fg = screen->pen.fg, + .bg = screen->pen.bg, + }; cell->pen.dwl = info->doublewidth; cell->pen.dhl = info->doubleheight; } @@ -1144,3 +1148,36 @@ { vterm_state_convert_color_to_rgb(screen->state, col); } + +static void reset_default_colours(VTermScreen *screen, ScreenCell *buffer) +{ + for(int row = 0; row <= screen->rows - 1; row++) + for(int col = 0; col <= screen->cols - 1; col++) { + ScreenCell *cell = &buffer[row * screen->cols + col]; + if(VTERM_COLOR_IS_DEFAULT_FG(&cell->pen.fg)) + cell->pen.fg = screen->pen.fg; + if(VTERM_COLOR_IS_DEFAULT_BG(&cell->pen.bg)) + cell->pen.bg = screen->pen.bg; + } +} + +void vterm_screen_set_default_colors(VTermScreen *screen, const VTermColor *default_fg, const VTermColor *default_bg) +{ + vterm_state_set_default_colors(screen->state, default_fg, default_bg); + + if(default_fg && VTERM_COLOR_IS_DEFAULT_FG(&screen->pen.fg)) { + screen->pen.fg = *default_fg; + screen->pen.fg.type = (screen->pen.fg.type & ~VTERM_COLOR_DEFAULT_MASK) + | VTERM_COLOR_DEFAULT_FG; + } + + if(default_bg && VTERM_COLOR_IS_DEFAULT_BG(&screen->pen.bg)) { + screen->pen.bg = *default_bg; + screen->pen.bg.type = (screen->pen.bg.type & ~VTERM_COLOR_DEFAULT_MASK) + | VTERM_COLOR_DEFAULT_BG; + } + + reset_default_colours(screen, screen->buffers[0]); + if(screen->buffers[1]) + reset_default_colours(screen, screen->buffers[1]); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/state.c new/libvterm-0.3.1/src/state.c --- old/libvterm-0.3/src/state.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/state.c 2023-01-15 23:21:59.000000000 +0100 @@ -1862,7 +1862,7 @@ return; } - vterm_push_output_sprintf_str(state->vt, C1_DCS, true, "0$r%s", tmp); + vterm_push_output_sprintf_str(state->vt, C1_DCS, true, "0$r"); } static int on_dcs(const char *command, size_t commandlen, VTermStringFragment frag, void *user) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/unicode.c new/libvterm-0.3.1/src/unicode.c --- old/libvterm-0.3/src/unicode.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/unicode.c 2023-01-15 23:21:59.000000000 +0100 @@ -212,19 +212,7 @@ } -static int mk_wcswidth(const uint32_t *pwcs, size_t n) -{ - int w, width = 0; - - for (;*pwcs && n-- > 0; pwcs++) - if ((w = mk_wcwidth(*pwcs)) < 0) - return -1; - else - width += w; - - return width; -} - +#ifdef USE_MK_WCWIDTH_CJK /* * The following functions are the same as mk_wcwidth() and @@ -302,19 +290,7 @@ return mk_wcwidth(ucs); } - -static int mk_wcswidth_cjk(const uint32_t *pwcs, size_t n) -{ - int w, width = 0; - - for (;*pwcs && n-- > 0; pwcs++) - if ((w = mk_wcwidth_cjk(*pwcs)) < 0) - return -1; - else - width += w; - - return width; -} +#endif // ################################ // ### The rest added by Paul Evans diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/vterm.c new/libvterm-0.3.1/src/vterm.c --- old/libvterm-0.3/src/vterm.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/vterm.c 2023-01-15 23:21:59.000000000 +0100 @@ -66,6 +66,8 @@ vt->parser.callbacks = NULL; vt->parser.cbdata = NULL; + vt->parser.emit_nul = false; + vt->outfunc = NULL; vt->outdata = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/src/vterm_internal.h new/libvterm-0.3.1/src/vterm_internal.h --- old/libvterm-0.3/src/vterm_internal.h 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/src/vterm_internal.h 2023-01-15 23:21:59.000000000 +0100 @@ -227,6 +227,8 @@ void *cbdata; bool string_initial; + + bool emit_nul; } parser; /* len == malloc()ed size; cur == number of valid bytes */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/t/64screen_pen.test new/libvterm-0.3.1/t/64screen_pen.test --- old/libvterm-0.3/t/64screen_pen.test 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/t/64screen_pen.test 2023-01-15 23:21:59.000000000 +0100 @@ -41,21 +41,31 @@ ?screen_cell 0,9 = {0x30} width=1 attrs={S_} fg=rgb(240,240,240) bg=rgb(0,0,0) ?screen_cell 0,10 = {0x32} width=1 attrs={S^} fg=rgb(240,240,240) bg=rgb(0,0,0) -!EL sets reverse and colours to end of line +!EL sets only colours to end of line, not other attrs PUSH "\e[H\e[7;33;44m\e[K" - ?screen_cell 0,0 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) - ?screen_cell 0,79 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) - -!DECSCNM xors reverse for entire screen -PUSH "\e[?5h" ?screen_cell 0,0 = {} width=1 attrs={} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 0,79 = {} width=1 attrs={} fg=rgb(224,224,0) bg=rgb(0,0,224) + +!DECSCNM xors reverse for entire screen +PUSH "R\e[?5h" + ?screen_cell 0,0 = {0x52} width=1 attrs={} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 1,0 = {} width=1 attrs={R} fg=rgb(240,240,240) bg=rgb(0,0,0) PUSH "\e[?5\$p" output "\e[?5;1\$y" PUSH "\e[?5l" - ?screen_cell 0,0 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) - ?screen_cell 0,79 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) + ?screen_cell 0,0 = {0x52} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 1,0 = {} width=1 attrs={} fg=rgb(240,240,240) bg=rgb(0,0,0) PUSH "\e[?5\$p" output "\e[?5;2\$y" + +!Set default colours +RESET +PUSH "ABC\e[31mDEF\e[m" + ?screen_cell 0,0 = {0x41} width=1 attrs={} fg=rgb(240,240,240) bg=rgb(0,0,0) + ?screen_cell 0,3 = {0x44} width=1 attrs={} fg=rgb(224,0,0) bg=rgb(0,0,0) +SETDEFAULTCOL rgb(252,253,254) + ?screen_cell 0,0 = {0x41} width=1 attrs={} fg=rgb(252,253,254) bg=rgb(0,0,0) + ?screen_cell 0,3 = {0x44} width=1 attrs={} fg=rgb(224,0,0) bg=rgb(0,0,0) +SETDEFAULTCOL rgb(250,250,250) rgb(10,20,30) + ?screen_cell 0,0 = {0x41} width=1 attrs={} fg=rgb(250,250,250) bg=rgb(10,20,30) + ?screen_cell 0,3 = {0x44} width=1 attrs={} fg=rgb(224,0,0) bg=rgb(10,20,30) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/t/69screen_sb_clear.test new/libvterm-0.3.1/t/69screen_sb_clear.test --- old/libvterm-0.3/t/69screen_sb_clear.test 1970-01-01 01:00:00.000000000 +0100 +++ new/libvterm-0.3.1/t/69screen_sb_clear.test 2023-01-15 23:21:59.000000000 +0100 @@ -0,0 +1,6 @@ +INIT +WANTSCREEN b + +!Clear scrollback +PUSH "\e[3J" + sb_clear diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/t/harness.c new/libvterm-0.3.1/t/harness.c --- old/libvterm-0.3/t/harness.c 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/t/harness.c 2023-01-15 23:21:59.000000000 +0100 @@ -81,6 +81,26 @@ printf(")"); } +static VTermColor strpe_color(char **strp) +{ + uint8_t r, g, b, idx; + int len = 0; + VTermColor col; + + if(sscanf(*strp, "rgb(%hhu,%hhu,%hhu)%n", &r, &g, &b, &len) == 3 && len > 0) { + *strp += len; + vterm_color_rgb(&col, r, g, b); + } + else if(sscanf(*strp, "idx(%hhu)%n", &idx, &len) == 1 && len > 0) { + *strp += len; + vterm_color_indexed(&col, idx); + } + else + vterm_color_rgb(&col, 127, 127, 127); + + return col; +} + static VTerm *vt; static VTermState *state; static VTermScreen *screen; @@ -908,6 +928,23 @@ vterm_screen_flush_damage(screen); } + else if(strstartswith(line, "SETDEFAULTCOL ")) { + assert(screen); + char *linep = line + 14; + while(linep[0] == ' ') + linep++; + VTermColor fg = strpe_color(&linep); + if(linep[0]) { + while(linep[0] == ' ') + linep++; + VTermColor bg = strpe_color(&linep); + + vterm_screen_set_default_colors(screen, &fg, &bg); + } + else + vterm_screen_set_default_colors(screen, &fg, NULL); + } + else if(line[0] == '?') { if(streq(line, "?cursor")) { assert(state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/tbl2inc_c.pl new/libvterm-0.3.1/tbl2inc_c.pl --- old/libvterm-0.3/tbl2inc_c.pl 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/tbl2inc_c.pl 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -my ( $encname ) = $ARGV[0] =~ m{/([^/.]+).tbl} - or die "Cannot parse encoding name out of $ARGV[0]\n"; - -print <<"EOF"; -static const struct StaticTableEncoding encoding_$encname = { - { .decode = &decode_table }, - { -EOF - -while( <> ) { - s/\s*#.*//; # strip comment - - s{^(\d+)/(\d+)}{sprintf "[0x%02x]", $1*16 + $2}e; # Convert 3/1 to [0x31] - s{"(.)"}{sprintf "0x%04x", ord $1}e; # Convert "A" to 0x41 - s{U\+}{0x}; # Convert U+0041 to 0x0041 - - s{$}{,}; # append comma - - print " $_"; -} - -print <<"EOF"; - } -}; -EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvterm-0.3/vterm.pc.in new/libvterm-0.3.1/vterm.pc.in --- old/libvterm-0.3/vterm.pc.in 2022-09-12 13:14:47.361000000 +0200 +++ new/libvterm-0.3.1/vterm.pc.in 2023-01-15 23:21:59.000000000 +0100 @@ -3,6 +3,6 @@ Name: vterm Description: Abstract VT220/Xterm/ECMA-48 emulation library -Version: @VERSION@ +Version: 0.3.1 Libs: -L${libdir} -lvterm Cflags: -I${includedir}
