[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A somewhat off-topic question about ncurses and wrapping long lines
From: |
Thomas Dickey |
Subject: |
Re: A somewhat off-topic question about ncurses and wrapping long lines |
Date: |
Sat, 1 Oct 2022 18:35:26 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sat, Oct 01, 2022 at 10:01:00AM +0100, Chris Green wrote:
> Well it's not entirely off topic, it's about something that works as
> I'd expect it to in vile (and less) but doesn't work right in mutt (my
> E-Mail program of choice).
>
> The issue is about how long chunks of text, with no spaces in them,
> are wrapped when they are too long to fit in the terminal width. The
> typical case (and the one that is a particular problem in mutt) is
> that of long URLs. This *isn't* about how these programs manage
> wrapping normal text made up of 'words' with spaces in between.
>
> In less or vile when there is a long piece of text and you have told
> less/vile to wrap long lines then the long URL (or whatever) is
> displayed wrapped at the right margin but it is still a single string
> and you can select it in the terminal by right clicking on it.
>
> In mutt (in mutt's internal pager specifically) however, although the
> URL is displayed the same (i.e. wrapped at the right margin) it's
> actually broken into one or more lines and you *can't* select it by
> right clicking on it, you just get the single line that you click on.
>
> This has been discussed at length at various times on the mutt mailing
> list and hasn't been solved.
I'm subscribed to mutt-dev (don't recall it there).
Perhaps mutt-user...
(none of the mutt development gets very deep into this stuff)
> Is there some specific way of using/calling ncurses which does what we
> want? ... and/or does ncurses default to breaking the string at the
> page margin and need some option to prevent it doing this?
It's a special case of xterm (imitated by more than one terminal emulator,
though probably not _all_). xterm notices when a line is written and
wraps. Screen updates that simply write to the end of a line (including
a previously "wrapped" line) make it forget about follow part of a line.
less and vile have an advantage over ncurses in deciding if a line is
wrapped -- ncurses can't tell if an application writes text (using one
of the wrapping calls such as waddch) intending to construct a long line.
Actually, long lines in mutt for me have a "+" marking the beginning
of the following lines (which iirc is configurable).
> I'm floundering a bit at understanding this as I'm not really sure
> it's an ncurses issue but it does seem to be pretty much the same
> regardless of other things. I use /usr/bin/xfce4-terminal but the
> same happens to lots of other people and I have tried other terminal
> emulators and seen no change.
>
> Can anyone throw any light on this?
>
> --
> Chris Green
>
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature