[4292] in BarnOwl Developers
[barnowl/barnowl] Escape @ in zephyr header fields and pick a safe
daemon@ATHENA.MIT.EDU (Daniel JB Clark)
Mon Nov 2 17:33:56 2026
Date: Mon, 02 Nov 2026 14:33:51 -0800
From: Daniel JB Clark <notifications@github.com>
Reply-To: barnowl/barnowl <reply+ABCERSOKSD4XUXR2KTXBBGTLMJM47EVBNHHQAAAAAFX6KOKD@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
----==_mimepart_6ae90fcf2150f_be12d078317
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
The class, instance, realm, opcode, sender and recipient of a zephyr are chosen by whoever sent it, but the default and oneline styles put them into ztext unchanged. An instance of `@b(x` made the rest of the header bold, `@color(red)` recoloured it, and a sender containing `}` ended the bold span around the sender early.
What changed:
1. escape_ztext turns @ into @@; bold_ztext wraps text in @b using the first of `{}` `[]` `<>` `()` whose closing delimiter is not in the text (unbold if all four occur).
2. The default and oneline styles use them for those fields. Oneline columns are escaped after they are cut to width, so a column keeps its width.
3. For other protocols the long sender is a name or a URL and is escaped too.
4. The message body and a zephyr's zsig stay ztext (the zsig deliberately goes through ztext, see ChangeLog).
Visible change: a name with an @ is now shown as written. A sender who put ztext in an instance (for example `@i(...)`) now shows the raw markup.
Tested: t/BarnOwl_Style_Default.t (new): hostile class, instance, realm, opcode, sender and recipient in every header shape (class, personal in/out, unauthenticated, ping, login, other protocols, oneline), the zsig staying ztext, the bold delimiter choice. It fails on the old code (112 failures) and passes with the change. `make check` passes on Linux (GitHub Actions, Debian trixie, 701 tests): https://github.com/djbclark/barnowl/actions/runs/41534395538
Not covered here (pre-existing): the sender and recipient do not go through humanize(..., 1), so a sender containing a newline can still draw a fake second header line (without markup now). That deserves its own small fix.
You can view, comment on, or merge this pull request online at:
https://github.com/barnowl/barnowl/pull/193
-- Commit Summary --
* Escape @ in zephyr header fields and pick a safe bold delimiter
-- File Changes --
M perl/lib/BarnOwl/Style/Default.pm (74)
M perl/lib/BarnOwl/Style/OneLine.pm (12)
A t/BarnOwl_Style_Default.t (233)
-- Patch Links --
https://github.com/barnowl/barnowl/pull/193.patch
https://github.com/barnowl/barnowl/pull/193.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/193
You are receiving this because you are subscribed to this thread.
Message ID: <barnowl/barnowl/pull/193@github.com>
----==_mimepart_6ae90fcf2150f_be12d078317
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p dir=3D"auto">The class, instance, realm, opcode, sender and recipient =
of a zephyr are chosen by whoever sent it, but the default and oneline st=
yles put them into ztext unchanged. An instance of <code class=3D"notrans=
late">@b(x</code> made the rest of the header bold, <code class=3D"notran=
slate">@color(red)</code> recoloured it, and a sender containing <code cl=
ass=3D"notranslate">}</code> ended the bold span around the sender early.=
</p>
<p dir=3D"auto">What changed:</p>
<ol dir=3D"auto">
<li>escape_ztext turns @ into @@; bold_ztext wraps text in <a class=3D"us=
er-mention notranslate" data-hovercard-type=3D"user" data-hovercard-url=3D=
"/users/b/hovercard" data-octo-click=3D"hovercard-link-click" data-octo-d=
imensions=3D"link_type:self" href=3D"https://github.com/b">@b</a> using t=
he first of <code class=3D"notranslate">{}</code> <code class=3D"notransl=
ate">[]</code> <code class=3D"notranslate"><></code> <code class=3D=
"notranslate">()</code> whose closing delimiter is not in the text (unbol=
d if all four occur).</li>
<li>The default and oneline styles use them for those fields. Oneline col=
umns are escaped after they are cut to width, so a column keeps its width=
.</li>
<li>For other protocols the long sender is a name or a URL and is escaped=
too.</li>
<li>The message body and a zephyr's zsig stay ztext (the zsig deliberatel=
y goes through ztext, see ChangeLog).</li>
</ol>
<p dir=3D"auto">Visible change: a name with an @ is now shown as written.=
A sender who put ztext in an instance (for example <code class=3D"notran=
slate">@i(...)</code>) now shows the raw markup.</p>
<p dir=3D"auto">Tested: t/BarnOwl_Style_Default.t (new): hostile class, i=
nstance, realm, opcode, sender and recipient in every header shape (class=
, personal in/out, unauthenticated, ping, login, other protocols, oneline=
), the zsig staying ztext, the bold delimiter choice. It fails on the old=
code (112 failures) and passes with the change. <code class=3D"notransla=
te">make check</code> passes on Linux (GitHub Actions, Debian trixie, 701=
tests): <a href=3D"https://github.com/djbclark/barnowl/actions/runs/4153=
4395538">https://github.com/djbclark/barnowl/actions/runs/41534395538</a>=
</p>
<p dir=3D"auto">Not covered here (pre-existing): the sender and recipient=
do not go through humanize(..., 1), so a sender containing a newline can=
still draw a fake second header line (without markup now). That deserves=
its own small fix.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href=3D'https://github.com/barnowl/barnowl/pull/193'>ht=
tps://github.com/barnowl/barnowl/pull/193</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href=3D"https://github.com/barnowl/barnowl/pull/193/commits/4fbe=
72b61deec2796572bc27a361656589f6da66" class=3D"commit-link">4fbe72b</a> =
Escape @ in zephyr header fields and pick a safe bold delimiter</li>
</ul>
<h4 style=3D"display: inline-block">File Changes </h4> <p style=3D"displa=
y: inline-block">(<a href=3D"https://github.com/barnowl/barnowl/pull/193/=
files">3 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href=3D"https://github.com/barnowl/barnowl/pull/193/files#diff-53a=
aefd5b60dc926b6ea112e29812e602750c8528602516818c98c23ac979853">perl/lib/B=
arnOwl/Style/Default.pm</a>
(74)
</li>
<li>
<strong>M</strong>
<a href=3D"https://github.com/barnowl/barnowl/pull/193/files#diff-deb=
e3e89011f542cb17034754fe32287d6c5d3a51d4a2d3be472ee3236ee3e6d">perl/lib/B=
arnOwl/Style/OneLine.pm</a>
(12)
</li>
<li>
<strong>A</strong>
<a href=3D"https://github.com/barnowl/barnowl/pull/193/files#diff-fd0=
9f575d4d15a0df97ccac5197fbb5f868c2146e8f0d231595a51e9197a77e4">t/BarnOwl_=
Style_Default.t</a>
(233)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href=3D'https://github.com/barnowl/barnowl/pull/193.patch'>https=
://github.com/barnowl/barnowl/pull/193.patch</a></li>
<li><a href=3D'https://github.com/barnowl/barnowl/pull/193.diff'>https:=
//github.com/barnowl/barnowl/pull/193.diff</a></li>
</ul>
<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&m=
dash;<br />Reply to this email directly, <a href=3D"https://github.com/ba=
rnowl/barnowl/pull/193?email_source=3Dnotifications&email_token=3DABC=
ERSOLDHH3IEO3JJNAPZ35XEDU7A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2W=
K43UF42TCMRYGUYDINZVGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6=
Y3MNFRWW">view it on GitHub</a>, or <a href=3D"https://github.com/notific=
ations/unsubscribe-auth/ABCERSKH6HJNXRVSADAWRCD5XEDU7AVCNFSNUABCKJSXA33TN=
F2G64TZHM3TINZTGA4TWSLTON2WKOZWGE3TEMRWGA3DONNBOYBA">unsubscribe</a>.<br =
/>Triage notifications, keep track of coding agent tasks and review pull =
requests on the go with GitHub Mobile for <a href=3D"https://github.com/n=
otifications/mobile/ios/ABCERSJQ23UNKID5XDNEJEL5XEDU7A5CNFSNUABEM5UWIORPF=
5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMRYGUYDINZVGGTHEZLBONXW5KTTOVRHGY3SNF=
RGKZFFMV3GK3TUVJTG633UMVZF62LPOM">iOS</a> and <a href=3D"https://github.c=
om/notifications/mobile/android/ABCERSI5QZMKG6YONC3FQSL5XEDU7A5CNFSNUABEM=
5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMRYGUYDINZVGGTHEZLBONXW5KTTOV=
RHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE">Android</a>. Download it =
today!
<br />You are receiving this because you are subscribed to this thread.<i=
mg src=3D"https://github.com/notifications/beacon/ABCERSODOJVOKEBR5JP6DZL=
5XEDU7BFCNFSM6AAAAADEC3XQYGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3J=
MTHQAAAAAFX6KOKDUZZGKYLTN5XKU43VMJZWG4TJMJSWI.gif" height=3D"1" width=3D"=
1" alt=3D"" /><span style=3D"color: transparent; font-size: 0; display: n=
one; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: =
0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><barn=
owl/barnowl/pull/193</span><span>@</span><span>github</span><span>.</span=
><span>com></span></span></p>
<script type=3D"application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/barnowl/barnowl/pull/193?email_source=3Dnot=
ifications\u0026email_token=3DABCERSNLXYAQ4DBXSCO3RXD5XEDU7A5CNFSNUABEM5U=
WIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMRYGUYDINZVGGTHEZLBONXW5KTTOVRH=
GY3SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"url": "https://github.com/barnowl/barnowl/pull/193?email_source=3Dnotifi=
cations\u0026email_token=3DABCERSNLXYAQ4DBXSCO3RXD5XEDU7A5CNFSNUABEM5UWIO=
RPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMRYGUYDINZVGGTHEZLBONXW5KTTOVRHGY3=
SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>
----==_mimepart_6ae90fcf2150f_be12d078317--