Re: The way mutt handles long lines, seems odd/wrong to me
On 01Oct2022 09:33, Chris Green wrote: As I said though it seems odd that only mutt suffers from the problem (on my xubuntu systems anyway). Presumably both 'less' and my editor 'vile' use ncurses too and they just wrap long lines if you tell them to do so. I'm pretty sure that less does not use curses (of whatever implementation). Termcap/terminfo, sure. But not curses, which maintains a model of the whole screen. I have a (vague) recollection that some terminals keep track of whether a line was terminates with a newline or not, and that it affects how copy/paste was done, in that a newline causes a break in the string. But the memory is vague. 1) is your long string using the full width of the terminal? i.e. is there a character in the rightmost column? 2) if the text does go to the rightmost column, but you have a break in the copied text, what's in that break? eg if you paste into an editor, what gets inserted there? Just curious, not sure this information would lead to a fix/workaround. Cheers, Cameron Simpson
Re: The way mutt handles long lines, seems odd/wrong to me
On Sat, Oct 01, 2022 at 01:11:10PM +, Sam Kuper wrote: > On Sat, Oct 01, 2022 at 09:33:16AM +0100, Chris Green wrote: > > On Sat, Oct 01, 2022 at 01:24:37PM +0800, Kevin J. McCarthy wrote: > >> In [the] past, I've tried a few things to see if it has an effect on > >> the output of long lines, but haven't found anything that makes a > >> difference. In the end, I believe it's a side effect of how ncurses > >> works. > > > > Yes, I realise this issue has been looked into before, and no solution > > found. [...] I'll have a talk with Tom Dickey who is the maintainer of > > both vile and ncurses, he may be able to throw some light on this. > > Workaround: while viewing an affected email in Mutt, press the vertical > bar key (`|`) and then type `less`. This will pipe the email to Less - > which, as you've noted, is unaffected by the issue. You can then select > URLs or other long whitespace-free text strings per your terminal's > normal behaviour. > > (You probably already knew this! But I'm mentioning it in case not, or > in case helpful for anyone else reading this thread.) > I actually have a macro implemented to do this, single key ('l') pipes the message into less. It's a reasonable workaround but one does have to hit 'q' twice to get back out of less. -- Chris Green
Re: The way mutt handles long lines, seems odd/wrong to me
On Sat, Oct 01, 2022 at 09:33:16AM +0100, Chris Green wrote: > On Sat, Oct 01, 2022 at 01:24:37PM +0800, Kevin J. McCarthy wrote: >> In [the] past, I've tried a few things to see if it has an effect on >> the output of long lines, but haven't found anything that makes a >> difference. In the end, I believe it's a side effect of how ncurses >> works. > > Yes, I realise this issue has been looked into before, and no solution > found. [...] I'll have a talk with Tom Dickey who is the maintainer of > both vile and ncurses, he may be able to throw some light on this. Workaround: while viewing an affected email in Mutt, press the vertical bar key (`|`) and then type `less`. This will pipe the email to Less - which, as you've noted, is unaffected by the issue. You can then select URLs or other long whitespace-free text strings per your terminal's normal behaviour. (You probably already knew this! But I'm mentioning it in case not, or in case helpful for anyone else reading this thread.) Cheers! Sam
Re: The way mutt handles long lines, seems odd/wrong to me
On Sat, Oct 01, 2022 at 01:24:37PM +0800, Kevin J. McCarthy wrote: > On Fri, Sep 30, 2022 at 02:42:09PM +0100, Chris Green wrote: > >I'm am also pretty sure that it's the mutt pager doing this as other > >programs (i.e. less) wrap long lines in a terminal window but don't > >chop them into pieces like mutt's pager. > > Mutt uses ncurses to draw on the screen, which is a layer of > indirection. Mutt is telling ncurses where to put things, but when Mutt > refreshes the screen, ncurses actually sends the needed commands and > contents to the terminal. > > In that past, I've tried a few things to see if it has an effect on the > output of long lines, but haven't found anything that makes a > difference. In the end, I believe it's a side effect of how ncurses > works. > Yes, I realise this issue has been looked into before, and no solution found. As I said though it seems odd that only mutt suffers from the problem (on my xubuntu systems anyway). Presumably both 'less' and my editor 'vile' use ncurses too and they just wrap long lines if you tell them to do so. I'll have a talk with Tom Dickey who is the maintainer of both vile and ncurses, he may be able to throw some light on this. -- Chris Green