[4295] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[barnowl/barnowl] Show newlines in message header fields (PR #196)

daemon@ATHENA.MIT.EDU (Daniel JB Clark)
Mon Nov 2 20:06:40 2026

Date: Mon, 02 Nov 2026 17:06:35 -0800
From: Daniel JB Clark <notifications@github.com>
Reply-To: barnowl/barnowl <reply+ABCERSPOPO63JLSQ6RNB33DLMJ6ZXEVBNHHQAAAAAFYABZ7Y@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>


----==_mimepart_6ae9339be68f0_e712d08489b
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

Body:
The sender and recipient of a message, and the host and tty of a login, are chosen by whoever sent it. `chat_header`, `format_login` and `format_ping` put them into the header unmodified, and `format_message`'s final `humanize` leaves newlines alone, so a sender whose name contains a newline (e.g. an unauthenticated zephyr notice) draws a second line that looks like part of the message.

Those fields now go through `humanize($_, 1)` like the class, instance and realm already do, so the newline shows as `^J`. In the oneline style, `format_login` and `format_ping` now go through `humanize_short` as `format_chat` does (newline shows as `?`; `humanize` markup would be cut by the column widths). The body is unchanged.

Related to #193: it touches the same functions for `@` escaping and bold delimiters. This PR is independent of it and is based on master; the changes overlap textually, so whichever merges second needs a small rebase (the `humanize(..., 1)` calls then wrap `escape_ztext(...)`).

Tested: new t/style-header-newline.t (hostile senders/recipients across class, personal, UNAUTH, out, login/logout, ping, default and oneline); fails on master, passes with the change; `make check` green on Linux.

You can view, comment on, or merge this pull request online at:

  https://github.com/barnowl/barnowl/pull/196

-- Commit Summary --

  * Show newlines in message header fields

-- File Changes --

    M perl/lib/BarnOwl/Style/Default.pm (14)
    M perl/lib/BarnOwl/Style/OneLine.pm (8)
    A t/style-header-newline.t (182)

-- Patch Links --

https://github.com/barnowl/barnowl/pull/196.patch
https://github.com/barnowl/barnowl/pull/196.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/196
You are receiving this because you are subscribed to this thread.

Message ID: <barnowl/barnowl/pull/196@github.com>

----==_mimepart_6ae9339be68f0_e712d08489b
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"auto">Body:<br>
The sender and recipient of a message, and the host and tty of a login, a=
re chosen by whoever sent it. <code class=3D"notranslate">chat_header</co=
de>, <code class=3D"notranslate">format_login</code> and <code class=3D"n=
otranslate">format_ping</code> put them into the header unmodified, and <=
code class=3D"notranslate">format_message</code>'s final <code class=3D"n=
otranslate">humanize</code> leaves newlines alone, so a sender whose name=
 contains a newline (e.g. an unauthenticated zephyr notice) draws a secon=
d line that looks like part of the message.</p>
<p dir=3D"auto">Those fields now go through <code class=3D"notranslate">h=
umanize($_, 1)</code> like the class, instance and realm already do, so t=
he newline shows as <code class=3D"notranslate">^J</code>. In the oneline=
 style, <code class=3D"notranslate">format_login</code> and <code class=3D=
"notranslate">format_ping</code> now go through <code class=3D"notranslat=
e">humanize_short</code> as <code class=3D"notranslate">format_chat</code=
> does (newline shows as <code class=3D"notranslate">?</code>; <code clas=
s=3D"notranslate">humanize</code> markup would be cut by the column width=
s). The body is unchanged.</p>
<p dir=3D"auto">Related to <a class=3D"issue-link js-issue-link" data-err=
or-text=3D"Failed to load title" data-id=3D"6172260675" data-permission-t=
ext=3D"Title is private" data-url=3D"https://github.com/barnowl/barnowl/i=
ssues/193" data-hovercard-type=3D"pull_request" data-hovercard-url=3D"/ba=
rnowl/barnowl/pull/193/hovercard" href=3D"https://github.com/barnowl/barn=
owl/pull/193">#193</a>: it touches the same functions for <code class=3D"=
notranslate">@</code> escaping and bold delimiters. This PR is independen=
t of it and is based on master; the changes overlap textually, so whichev=
er merges second needs a small rebase (the <code class=3D"notranslate">hu=
manize(..., 1)</code> calls then wrap <code class=3D"notranslate">escape_=
ztext(...)</code>).</p>
<p dir=3D"auto">Tested: new t/style-header-newline.t (hostile senders/rec=
ipients across class, personal, UNAUTH, out, login/logout, ping, default =
and oneline); fails on master, passes with the change; <code class=3D"not=
ranslate">make check</code> green on Linux.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href=3D'https://github.com/barnowl/barnowl/pull/196'>ht=
tps://github.com/barnowl/barnowl/pull/196</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href=3D"https://github.com/barnowl/barnowl/pull/196/commits/1288=
509da6b9c1e274a45a9c38b5db3e92b74954" class=3D"commit-link">1288509</a>  =
Show newlines in message header fields</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/196/=
files">3&nbsp;files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href=3D"https://github.com/barnowl/barnowl/pull/196/files#diff-53a=
aefd5b60dc926b6ea112e29812e602750c8528602516818c98c23ac979853">perl/lib/B=
arnOwl/Style/Default.pm</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href=3D"https://github.com/barnowl/barnowl/pull/196/files#diff-deb=
e3e89011f542cb17034754fe32287d6c5d3a51d4a2d3be472ee3236ee3e6d">perl/lib/B=
arnOwl/Style/OneLine.pm</a>
    (8)
  </li>
  <li>
    <strong>A</strong>
    <a href=3D"https://github.com/barnowl/barnowl/pull/196/files#diff-812=
f1d8fba833456ae06bfeb19ea5874dbc9a1dbe4a910c7124f4a9be8b8bb2e">t/style-he=
ader-newline.t</a>
    (182)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href=3D'https://github.com/barnowl/barnowl/pull/196.patch'>https=
://github.com/barnowl/barnowl/pull/196.patch</a></li>
  <li><a href=3D'https://github.com/barnowl/barnowl/pull/196.diff'>https:=
//github.com/barnowl/barnowl/pull/196.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/196?email_source=3Dnotifications&amp;email_token=3DABC=
ERSKNMUYV3UDQWAQZG7L5XEVRXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2W=
K43UF42TCMZQGAZDSOBRGKTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6=
Y3MNFRWW">view it on GitHub</a>, or <a href=3D"https://github.com/notific=
ations/unsubscribe-auth/ABCERSPOJB3XMEHTCFQS6QT5XEVRXAVCNFSNUABCKJSXA33TN=
F2G64TZHM3TINZTGA4TWSLTON2WKOZWGE3TIMBXGQ4DOMVBOYBA">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/ABCERSJ37654HRPHH3ONKTT5XEVRXA5CNFSNUABEM5UWIORPF=
5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMZQGAZDSOBRGKTHEZLBONXW5KTTOVRHGY3SNF=
RGKZFFMV3GK3TUVJTG633UMVZF62LPOM">iOS</a> and <a href=3D"https://github.c=
om/notifications/mobile/android/ABCERSLONSOC5BW3OC5WHUD5XEVRXA5CNFSNUABEM=
5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMZQGAZDSOBRGKTHEZLBONXW5KTTOV=
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/ABCERSNC7Z62PXDO6WMADHL=
5XEVRXBFCNFSM6AAAAADEDGLNHCWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3J=
MTHQAAAAAFYABZ7YUZZGKYLTN5XKU43VMJZWG4TJMJSWI.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>&lt;barn=
owl/barnowl/pull/196</span><span>@</span><span>github</span><span>.</span=
><span>com&gt;</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/196?email_source=3Dnot=
ifications\u0026email_token=3DABCERSLG7ZRTILTVW5YISZL5XEVRXA5CNFSNUABEM5U=
WIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMZQGAZDSOBRGKTHEZLBONXW5KTTOVRH=
GY3SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"url": "https://github.com/barnowl/barnowl/pull/196?email_source=3Dnotifi=
cations\u0026email_token=3DABCERSLG7ZRTILTVW5YISZL5XEVRXA5CNFSNUABEM5UWIO=
RPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TCMZQGAZDSOBRGKTHEZLBONXW5KTTOVRHGY3=
SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>

----==_mimepart_6ae9339be68f0_e712d08489b--

home help back first fref pref prev next nref lref last post