Hello community, here is the log from the commit of package kitty for openSUSE:Factory checked in at 2020-10-06 17:11:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kitty (Old) and /work/SRC/openSUSE:Factory/.kitty.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kitty" Tue Oct 6 17:11:01 2020 rev:19 rq:839727 version:0.19.1 Changes: -------- --- /work/SRC/openSUSE:Factory/kitty/kitty.changes 2020-10-05 19:43:08.749787569 +0200 +++ /work/SRC/openSUSE:Factory/.kitty.new.4249/kitty.changes 2020-10-06 17:15:44.173766371 +0200 @@ -1,0 +2,9 @@ +Tue Oct 6 08:49:21 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 0.19.1: + * hints kitten: Add an ip type for easy selection of IP addresses (#3009) + * Fix a regression that caused a segfault when using + scrollback_pager_history_size and it needs to be expanded (#3011) + * Fix update available notifications repeating (#3006) + +------------------------------------------------------------------- Old: ---- kitty-0.19.0.tar.gz New: ---- kitty-0.19.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kitty.spec ++++++ --- /var/tmp/diff_new_pack.Kn8RGA/_old 2020-10-06 17:15:48.645770165 +0200 +++ /var/tmp/diff_new_pack.Kn8RGA/_new 2020-10-06 17:15:48.645770165 +0200 @@ -17,7 +17,7 @@ Name: kitty -Version: 0.19.0 +Version: 0.19.1 Release: 0 Summary: A GPU-based terminal emulator License: GPL-3.0-only ++++++ kitty-0.19.0.tar.gz -> kitty-0.19.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/.github/workflows/ci.py new/kitty-0.19.1/.github/workflows/ci.py --- old/kitty-0.19.0/.github/workflows/ci.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/.github/workflows/ci.py 2020-10-06 10:33:25.000000000 +0200 @@ -40,7 +40,7 @@ if is_bundle: install_bundle() else: - run('pip install Pillow pygments') + run('pip3 install Pillow pygments') def build_kitty(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/docs/changelog.rst new/kitty-0.19.1/docs/changelog.rst --- old/kitty-0.19.0/docs/changelog.rst 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/docs/changelog.rst 2020-10-06 10:33:25.000000000 +0200 @@ -4,6 +4,18 @@ |kitty| is a feature full, cross-platform, *fast*, GPU based terminal emulator. To update |kitty|, :doc:`follow the instructions <binary>`. +0.19.1 [2020-10-06] +------------------- + +- hints kitten: Add an ``ip`` type for easy selection of IP addresses + (:pull:`3009`) + +- Fix a regression that caused a segfault when using + :opt:`scrollback_pager_history_size` and it needs to be expanded (:iss:`3011`) + +- Fix update available notifications repeating (:pull:`3006`) + + 0.19.0 [2020-10-04] ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/docs/kittens/hyperlinked_grep.rst new/kitty-0.19.1/docs/kittens/hyperlinked_grep.rst --- old/kitty-0.19.0/docs/kittens/hyperlinked_grep.rst 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/docs/kittens/hyperlinked_grep.rst 2020-10-06 10:33:25.000000000 +0200 @@ -34,7 +34,7 @@ Finally, add an alias to your shell's rc files to invoke the kitten as ``hg``:: - alias hg='kitty +kitten hyperlink_grep' + alias hg='kitty +kitten hyperlinked_grep' You can now run searches with:: @@ -42,10 +42,17 @@ hg some-search-term If you want to enable completion, for the kitten, you can delegate completion -to rg. For ZSH, you do that with:: +to rg. For that, instead of using an alias create a simple wrapper script named +:file:`hg` somewhere in your ``PATH``: - compdef _rg kitty +kitten hyperlinked_grep +.. code-block:: sh + #!/bin/sh + exec kitty +kitten hyperlinked_grep "$@" + +Then, for example, for ZSH, add the following to :file:`.zshrc`:: + + compdef _rg hg To learn more about kitty's powerful framework for customizing URL click actions, :doc:`see here <../open_actions>`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/docs/protocol-extensions.rst new/kitty-0.19.1/docs/protocol-extensions.rst --- old/kitty-0.19.0/docs/protocol-extensions.rst 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/docs/protocol-extensions.rst 2020-10-06 10:33:25.000000000 +0200 @@ -250,12 +250,13 @@ <OSC> 99 ; metadata ; payload <terminator> -Here ``<OSC>`` is :code:`<ESC>]` and ``<terminator>`` is :code:`<ESC><backslash>`. The -metadata is a section of colon separated :code:`key=value` pairs. Every key -must be a single character from the set :code:`[a-zA-Z]` and every value must -be a character from the set :code:`a-zA-Z0-9-_/\+.,(){}[]*&^%$#@!`~`. The -payload must be interpreted based on the metadata section. The two semi-colons -*must* always be present even when no metadata is present. +Here ``<OSC>`` is :code:`<ESC>]` and ``<terminator>`` is +:code:`<ESC><backslash>`. The metadata is a section of colon separated +:code:`key=value` pairs. Every key must be a single character from the set +:code:`a-zA-Z` and every value must be a word consisting of characters from +the set :code:`a-zA-Z0-9-_/\+.,(){}[]*&^%$#@!`~`. The payload must be +interpreted based on the metadata section. The two semi-colons *must* always be +present even when no metadata is present. Before going into details, lets see how one can display a simple, single line notification from a shell script:: @@ -297,7 +298,7 @@ separated set of values, ``report`` and ``focus``. The value ``focus`` means focus the window from which the notification was issued and is the default. ``report`` means send an escape code back to the application. The format of the -escape code is:: +returned escape code is:: <OSC> 99 ; i=identifier ; <terminator> @@ -322,7 +323,7 @@ allow displaying custom icons on a notification, at all, it was decided to leave it out of the spec for the time being. - Similarly, features such a scheduled notifications could be added in future + Similarly, features such as scheduled notifications could be added in future revisions. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/glfw/cocoa_monitor.m new/kitty-0.19.1/glfw/cocoa_monitor.m --- old/kitty-0.19.0/glfw/cocoa_monitor.m 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/glfw/cocoa_monitor.m 2020-10-06 10:33:25.000000000 +0200 @@ -529,7 +529,6 @@ *width = (int)frameRect.size.width; if (height) *height = (int)frameRect.size.height; - } GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/glfw/cocoa_window.m new/kitty-0.19.1/glfw/cocoa_window.m --- old/kitty-0.19.0/glfw/cocoa_window.m 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/glfw/cocoa_window.m 2020-10-06 10:33:25.000000000 +0200 @@ -1595,10 +1595,10 @@ void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom) { - if (numer != GLFW_DONT_CARE && denom != GLFW_DONT_CARE) - [window->ns.object setContentAspectRatio:NSMakeSize(numer, denom)]; - else + if (numer == GLFW_DONT_CARE || denom == GLFW_DONT_CARE) [window->ns.object setResizeIncrements:NSMakeSize(1.0, 1.0)]; + else + [window->ns.object setContentAspectRatio:NSMakeSize(numer, denom)]; } void _glfwPlatformSetWindowSizeIncrements(_GLFWwindow* window, int widthincr, int heightincr) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/graphics-protocol.asciidoc new/kitty-0.19.1/graphics-protocol.asciidoc --- old/kitty-0.19.0/graphics-protocol.asciidoc 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/graphics-protocol.asciidoc 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -See https://sw.kovidgoyal.net/kitty/graphics-protocol.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/key_encoding.asciidoc new/kitty-0.19.1/key_encoding.asciidoc --- old/kitty-0.19.0/key_encoding.asciidoc 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/key_encoding.asciidoc 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -See https://sw.kovidgoyal.net/kitty/key-encoding.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/kittens/hints/main.py new/kitty-0.19.1/kittens/hints/main.py --- old/kitty-0.19.0/kittens/hints/main.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/kittens/hints/main.py 2020-10-06 10:33:25.000000000 +0200 @@ -236,6 +236,11 @@ return func +class InvalidMatch(Exception): + """Raised when a match turns out to be invalid.""" + pass + + @postprocessor def url(text: str, s: int, e: int) -> Tuple[int, int]: if s > 4 and text[s - 5:s] == 'link:': # asciidoc URLs @@ -280,11 +285,29 @@ return s, e +@postprocessor +def ip(text: str, s: int, e: int) -> Tuple[int, int]: + from ipaddress import ip_address + # Check validity of IPs (or raise InvalidMatch) + ip = text[s:e] + + try: + ip_address(ip) + except Exception: + raise InvalidMatch("Invalid IP") + + return s, e + + def mark(pattern: str, post_processors: Iterable[PostprocessorFunc], text: str, args: HintsCLIOptions) -> Generator[Mark, None, None]: pat = re.compile(pattern) for idx, (s, e, groupdict) in enumerate(regex_finditer(pat, args.minimum_match_length, text)): - for func in post_processors: - s, e = func(text, s, e) + try: + for func in post_processors: + s, e = func(text, s, e) + except InvalidMatch: + continue + mark_text = text[s:e].replace('\n', '').replace('\0', '') yield Mark(idx, s, e, mark_text, groupdict) @@ -325,6 +348,15 @@ pattern = '(?m)^\\s*(.+)[\\s\0]*$' elif args.type == 'hash': pattern = '[0-9a-f]{7,128}' + elif args.type == 'ip': + pattern = ( + # # IPv4 with no validation + r"((?:\d{1,3}\.){3}\d{1,3}" + r"|" + # # IPv6 with no validation + r"(?:[a-fA-F0-9]{0,4}:){2,7}[a-fA-F0-9]{1,4})" + ) + post_processors.append(ip) elif args.type == 'word': chars = args.word_characters if chars is None: @@ -402,7 +434,7 @@ active_hyperlink_start_offset = 0 idx += 1 - def process_hyperlink(m: re.Match) -> str: + def process_hyperlink(m: 're.Match') -> str: nonlocal removed_size, active_hyperlink_url, active_hyperlink_id, active_hyperlink_start_offset raw = m.group() start = m.start() - removed_size @@ -482,7 +514,7 @@ --type default=url -choices=url,regex,path,line,hash,word,linenum,hyperlink +choices=url,regex,path,line,hash,word,linenum,hyperlink,ip The type of text to search for. A value of :code:`linenum` is special, it looks for error messages using the pattern specified with :option:`--regex`, which must have the named groups, :code:`path` and :code:`line`. If not specified, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/kitty/boss.py new/kitty-0.19.1/kitty/boss.py --- old/kitty-0.19.0/kitty/boss.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/kitty/boss.py 2020-10-06 10:33:25.000000000 +0200 @@ -1563,6 +1563,7 @@ for os_window_id in os_windows: self.default_bg_changed_for(os_window_id) + # Can be called with kitty -o "map f1 send_test_notification" def send_test_notification(self) -> None: from time import monotonic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/kitty/constants.py new/kitty-0.19.1/kitty/constants.py --- old/kitty-0.19.0/kitty/constants.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/kitty/constants.py 2020-10-06 10:33:25.000000000 +0200 @@ -20,7 +20,7 @@ appname: str = 'kitty' -version: Version = Version(0, 19, 0) +version: Version = Version(0, 19, 1) str_version: str = '.'.join(map(str, version)) _plat = sys.platform.lower() is_macos: bool = 'darwin' in _plat diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/kitty/history.c new/kitty-0.19.1/kitty/history.c --- old/kitty-0.19.0/kitty/history.c 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/kitty/history.c 2020-10-06 10:33:25.000000000 +0200 @@ -78,8 +78,8 @@ static inline bool pagerhist_extend(PagerHistoryBuf *ph, size_t minsz) { if (ph->buffer_size >= ph->max_sz) return false; - size_t newsz = ph->buffer_size + MAX(1024u * 1024u, minsz); - uint8_t *newbuf = PyMem_Malloc(MIN(ph->buffer_size + minsz, ph->max_sz)); + size_t newsz = MIN(ph->max_sz, ph->buffer_size + MAX(1024u * 1024u, minsz)); + uint8_t *newbuf = PyMem_Malloc(newsz); if (!newbuf) return false; size_t copied = MIN(ph->length, ph->buffer_size - ph->start); if (copied) memcpy(newbuf, ph->buffer + ph->start, copied); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/kitty/update_check.py new/kitty-0.19.1/kitty/update_check.py --- old/kitty-0.19.0/kitty/update_check.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/kitty/update_check.py 2020-10-06 10:33:25.000000000 +0200 @@ -90,7 +90,9 @@ for version in sorted(notified_versions): n = notified_versions[version] lines.append('{},{},{}'.format( - '.'.join(map(str, n.version)), n.time_of_last_notification, n.count)) + '.'.join(map(str, n.version)), + n.time_of_last_notification, + n.notification_count)) atomic_save('\n'.join(lines).encode('utf-8'), version_notification_log()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/kitty_tests/hints.py new/kitty-0.19.1/kitty_tests/hints.py --- old/kitty-0.19.0/kitty_tests/hints.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/kitty_tests/hints.py 2020-10-06 10:33:25.000000000 +0200 @@ -30,3 +30,31 @@ t('link:{}[xxx]'.format(u), u) t('`xyz <{}>`_.'.format(u), u) t('<a href="{}">moo'.format(u), u) + + def test_ip_hints(self): + from kittens.hints.main import parse_hints_args, functions_for, mark, convert_text + args = parse_hints_args(['--type', 'ip'])[0] + pattern, post_processors = functions_for(args) + + def create_marks(text, cols=60): + text = convert_text(text, cols) + return tuple(mark(pattern, post_processors, text, args)) + + testcases = ( + ('100.64.0.0', ['100.64.0.0']), + ('2001:0db8:0000:0000:0000:ff00:0042:8329', ['2001:0db8:0000:0000:0000:ff00:0042:8329']), + ('2001:db8:0:0:0:ff00:42:8329', ['2001:db8:0:0:0:ff00:42:8329']), + ('2001:db8::ff00:42:8329', ['2001:db8::ff00:42:8329']), + ('2001:DB8::FF00:42:8329', ['2001:DB8::FF00:42:8329']), + ('0000:0000:0000:0000:0000:0000:0000:0001', ['0000:0000:0000:0000:0000:0000:0000:0001']), + ('::1', ['::1']), + # Invalid IPs won't match + ('255.255.255.256', []), + (':1', []), + ) + + for testcase, expected in testcases: + with self.subTest(testcase=testcase, expected=expected): + marks = create_marks(testcase) + ips = [m.text for m in marks] + self.ae(ips, expected) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/protocol-extensions.asciidoc new/kitty-0.19.1/protocol-extensions.asciidoc --- old/kitty-0.19.0/protocol-extensions.asciidoc 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/protocol-extensions.asciidoc 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -See https://sw.kovidgoyal.net/kitty/protocol-extensions.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/publish.py new/kitty-0.19.1/publish.py --- old/kitty-0.19.0/publish.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/publish.py 2020-10-06 10:33:25.000000000 +0200 @@ -68,14 +68,15 @@ def add_analytics() -> None: analytics = ''' -<!-- Google Analytics --> +<!-- Global site tag (gtag.js) - Google Analytics --> +<script async src="https://www.googletagmanager.com/gtag/js?id=UA-20736318-2"></script> <script> -window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; -ga('create', 'UA-20736318-2', 'auto'); -ga('send', 'pageview'); + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + + gtag('config', 'UA-20736318-2'); </script> -<script async="async" src='https://www.google-analytics.com/analytics.js'></script> -<!-- End Google Analytics -->\ ''' for dirpath, firnames, filenames in os.walk(publish_dir): for fname in filenames: @@ -87,6 +88,10 @@ f.write(html.encode('utf-8')) +def run_docs(args: Any) -> None: + subprocess.check_call(['make', 'docs']) + + def run_website(args: Any) -> None: if os.path.exists(publish_dir): shutil.rmtree(publish_dir) @@ -384,6 +389,8 @@ ans = 'n' if ans.lower() != 'y': return + if actions == ['website']: + actions.insert(0, 'docs') for action in actions: print('Running', action) cwd = os.getcwd() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/remote-control.asciidoc new/kitty-0.19.1/remote-control.asciidoc --- old/kitty-0.19.0/remote-control.asciidoc 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/remote-control.asciidoc 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -See https://sw.kovidgoyal.net/kitty/remote-control.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitty-0.19.0/setup.py new/kitty-0.19.1/setup.py --- old/kitty-0.19.0/setup.py 2020-10-04 16:26:10.000000000 +0200 +++ new/kitty-0.19.1/setup.py 2020-10-06 10:33:25.000000000 +0200 @@ -1176,8 +1176,6 @@ def main() -> None: global verbose - if sys.version_info < (3, 5): - raise SystemExit('python >= 3.5 required') args = option_parser().parse_args(namespace=Options()) verbose = args.verbose > 0 args.prefix = os.path.abspath(args.prefix)
