zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: highlight test cases (was Re: [BUG?] If true-color is used, overlapping colors do not work)
Date: Sat, 24 Nov 2018 18:32:23 +0100	[thread overview]
Message-ID: <31159-1543080743.164776@h8df.-SiL.hblq> (raw)
In-Reply-To: <CAKc7PVBpL_HwKUHLD5mQCLmWszfnrbJ2ARyrkzVKsi6yStWeNA@mail.gmail.com>

On 11 Nov, Sebastian Gniazdowski wrote:
> I have new fresh test file which I hope brings the X04 test to some
> new stage or level. The lines sent to zpty now aren't repeated,

Sorry, I hadn't found time to look at this. Given that ensuring
portability has proved tricky with the existing zpty based tests I'm
rather leery of including new ones and would be happier if someone else
were to take a look.

The tests now pass on my system.

> I've used zle -T tc tcfunc, which sets REPLY="", i.e. discards the
> codes. Should I change them to something? Because I'm only getting LE

If removing them works for the particular tests then I'd have thought
this was fine.

> I'm currently removing following escapes from all zpty output:
> - ^[[?2004h
> - ^[[?2004l

unsetting zle_bracketed_paste will prevent zsh from generating these
which is better than removing them afterwards.

> PS. Didn't yet search for terminfo file, just did export
> TERM=xterm-256, not actually sure how to search for the definition

Searching probably isn't easy to do portably. Perhaps guessing like this
is better, but it would be good to check $termcap[Co] afterwards and
skip tests as appropriate.

>       { zpty -r zsh } | sed $'/[^[:space:]]/!d; s/\r$//; s/\x1b\\[[0-9;]*m//g; s/\x1b\\[[JK]//g; s/\x1b\\[?[0-9]*[hl]//g' | while read REPLY; do REPLY=${REPLY//(#b)((?(#c0,1))$cm(?(#c0,1)))/${${${(M)match[2]:#${match[3]}}:+${match[2]}}:-${${match[1]##[[:space:]]##}%%[[:space:]]##}}}; print -rn -- "$REPLY"; done

This use of sed isn't portable. In particular, the use of semi-colons to
separate commands and the [[:space:]] character class are extensions.
You can use literal spaces and multiple -e options. Either that
or do the substitutions in zsh.

The heirloom project (http://heirloom.sourceforge.net/tools.html) is a
good source for lowest common denominator versions of Unix tools if you
don't have an old OS available.

Oliver

  parent reply	other threads:[~2018-11-24 17:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 13:19 [BUG?] If true-color is used, overlapping colors do not work Sebastian Gniazdowski
2018-11-07 14:40 ` Sebastian Gniazdowski
2018-11-07 19:19   ` Sebastian Gniazdowski
2018-11-08  3:48     ` Oliver Kiddle
2018-11-08  9:25       ` Sebastian Gniazdowski
2018-11-08  3:03 ` Oliver Kiddle
2018-11-08  9:19   ` Sebastian Gniazdowski
2018-11-09  1:28     ` Oliver Kiddle
2018-11-09 15:39       ` Sebastian Gniazdowski
2018-11-11  0:43       ` Sebastian Gniazdowski
2018-11-11  5:11         ` Sebastian Gniazdowski
2018-11-24 17:32         ` Oliver Kiddle [this message]
2018-11-30  0:34           ` highlight test cases (was Re: [BUG?] If true-color is used, overlapping colors do not work) Sebastian Gniazdowski
2018-12-07  1:55             ` [BUG] General 256 colors bug – zle_highlight / fg_start_code, etc. is not respected (was: highlight test cases) Sebastian Gniazdowski
2018-12-07 20:26               ` Sebastian Gniazdowski
2018-12-09 19:13                 ` Daniel Shahaf
2018-12-11  8:06                   ` Sebastian Gniazdowski
2018-12-10  2:54             ` highlight test cases (was Re: [BUG?] If true-color is used, overlapping colors do not work) Oliver Kiddle
2018-12-10 23:51               ` Sebastian Gniazdowski
2018-12-10 23:54                 ` Sebastian Gniazdowski
2018-11-11  5:38       ` X04 zle highlight tests, near-color bug Sebastian Gniazdowski
2018-11-18 15:34         ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31159-1543080743.164776@h8df.-SiL.hblq \
    --to=okiddle@yahoo.co.uk \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).