Re: Piping/Printing message looks odd TODO
Thomas Dickey <[email protected]> Tue, 15 Mar 2016 05:10:19 -0400
| Newsgroups | gmane.network.tin.user |
|---|---|
| Message-ID | <[email protected]> |
--===============5476129521364345291==
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v"
Content-Disposition: inline
--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Mar 15, 2016 at 08:04:12AM +0100, Urs Jan=DFen wrote:
> On Mon, Mar 14, 2016 at 08:45:13PM -0400, Glenn Spell wrote:
> > For years the following note has been in the tin feed.c file
> > concerning the piping and printing messages:
> >=20
> > /* TODO: looks odd because screen mode is raw */
> >=20
> > For almost fifteen years this has been a problem with tin on NetBSD.
> >=20
> > Here's what the problem looks like when piping a thread:
> >=20
> > Piping... (7/261) 98% Piping... (18/261) 45% Piping... (18/261) 91%
> > (0:00 remaining)Piping... (23/261) 100% Piping... (43/261) 83% Pipin
> > g... (47/261) 48% Piping... (47/261) 96% (0:00 remaining)Piping... (
> > 54/261) 98% Piping... (55/261) 64% Piping... (56/261) 94% Piping...
> >=20
> > Is there a terminal setting that might affect this issue?
>=20
> AFAIK no
>=20
> > As an illustration, the following patch provides me with a workaround
> > for this issue.
>=20
> It doesn't make any differfence here - looks as ugly as always on
> x86_64-pc-linux-gnu; ncursesw5.
>=20
> > Is there some better way to deal with this issue?
>=20
> just a guess: if there would have been an easy fix (except per message mo=
de
> switching) it would have been implemented right away ...
> Maybe Thomas has an idea.
not offhand (I may have written the comment).
ncurses (any curses implementation) puts the terminal input/output into
raw mode, which in this case means that carriage returns and line-feeds
are not interpreted by the terminal driver.
=20
> > Index: src/feed.c
> > --- tin-2.3.2.orig/src/feed.c 2015-11-22 00:14:30.000000000 +0000
> > +++ tin-2.3.2/src/feed.c 2016-03-12 02:26:33.000000000 +0000
> > @@ -440,6 +440,8 @@ feed_article(
> > #ifndef DONT_HAVE_PIPING
> > case FEED_PIPE:
> > /* TODO: looks odd because screen mode is raw */
> > + echochar(13);
> > + clrtoeol();
The code looks "okay", but (reading the source), I think the fix should
be in screen.c within show_progress().
> > progress_mesg =3D fmt_string("%s (%d/%d)", _(tx=
t_piping), counter->total, counter->max);
> > break;
> > #endif /* !DONT_HAVE_PIPING */
> > @@ -447,6 +449,8 @@ feed_article(
> > #ifndef DISABLE_PRINTING
> > case FEED_PRINT:
> > /* TODO: looks odd because screen mode is raw */
> > + echochar(13);
> > + clrtoeol();
> > progress_mesg =3D fmt_string("%s (%d/%d)", _(tx=
t_printing), counter->total, counter->max);
> > break;
> > #endif /* !DISABLE_PRINTING */
> > Index: src/lang.c
> > --- tin-2.3.2.orig/src/lang.c 2015-11-22 00:14:30.000000000 +0000
> > +++ tin-2.3.2/src/lang.c 2016-03-12 02:25:55.000000000 +0000
> > @@ -1141,7 +1141,7 @@ Tin will try to use XHDR XREF instead (s
> > constext txt_articles_printed[] =3D N_("%d %s printed");
> > constext txt_help_global_print[] =3D N_("output article/thread/=
hot/pattern/tagged articles to printer");
> > constext txt_print[] =3D N_("Print");
> > - constext txt_printing[] =3D N_("Printing...");
> > + constext txt_printing[] =3D N_("\rPrinting...");
adding formatting to messages doesn't seem the right solution
> > #endif /* !DISABLE_PRINTING */
> > =20
> > #ifndef DONT_HAVE_PIPING
> > @@ -1149,7 +1149,7 @@ Tin will try to use XHDR XREF instead (s
> > constext txt_no_command[] =3D N_("No command");
> > constext txt_pipe[] =3D N_("Pipe");
> > constext txt_pipe_to_command[] =3D N_("Pipe to command [%.*s]> =
");
> > - constext txt_piping[] =3D N_("Piping...");
> > + constext txt_piping[] =3D N_("\rPiping...");
> > #else
> > constext txt_piping_not_enabled[] =3D N_("Piping not enabled.");
> > #endif /* !DONT_HAVE_PIPING */
> >=20
--=20
Thomas E. Dickey <[email protected]>
http://invisible-island.net
ftp://invisible-island.net
--Dxnq1zWXvFF0Q93v
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlbn0XsACgkQcCNT4Pfkjtva6QCfdeLvLeRmlh5XdRjwo+Zasgo/
jAEAn2bvDB+fWZs2aehjEV0hVHqNsR9u
=4QYf
-----END PGP SIGNATURE-----
--Dxnq1zWXvFF0Q93v--
--===============5476129521364345291==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KdGluLXVzZXJz
IG1haWxpbmcgbGlzdAp0aW4tdXNlcnNAdGluLm9yZwpodHRwOi8vbGlzdHMudGluLm9yZy9jZ2kt
YmluL21haWxtYW4vbGlzdGluZm8vdGluLXVzZXJzCg==
--===============5476129521364345291==--