Discussion:
mutt, gnome-terminal and whitespace fill issue
Will Fiveash
2010-08-06 22:44:11 UTC
Permalink
I've noticed that when I do a X mouse copy of text that mutt displays
in a gnome-terminal that there is whitespace padding out to edge of the
terminal. If I run the less pager command in a gnome-terminal I don't
see this whitespace pad/fill behavior. Is there a way I can configure
mutt or my gnome-terminal to disable this whitespace fill behavior?

I'm running OpenSolaris (a recent internal build) and a current dev.
version of Mutt 1.5.20 (2010-08-04).
--
Will Fiveash
Michael Elkins
2010-08-07 00:26:22 UTC
Permalink
Post by Will Fiveash
I've noticed that when I do a X mouse copy of text that mutt displays
in a gnome-terminal that there is whitespace padding out to edge of the
terminal. If I run the less pager command in a gnome-terminal I don't
see this whitespace pad/fill behavior. Is there a way I can configure
mutt or my gnome-terminal to disable this whitespace fill behavior?
Hopefully Thomas Dickey will correct me if I'm wrong, but I'm pretty sure this
has to do with the use of bkgdset() so that clrtoeol() will set the proper
background color all the way to the end of the line.

Consider the case where you have a different default background terminal color
than what the user has specified in 'color body ...'. Without the use of
bkgdset(), you'd see the wrong color at the end of each line.

xterm has the 'trimSelection' option for this purpose, but gnome-terminal
doesn't seem to support it.

me
Will Fiveash
2010-08-07 18:26:03 UTC
Permalink
Post by Michael Elkins
Post by Will Fiveash
I've noticed that when I do a X mouse copy of text that mutt displays
in a gnome-terminal that there is whitespace padding out to edge of the
terminal. If I run the less pager command in a gnome-terminal I don't
see this whitespace pad/fill behavior. Is there a way I can configure
mutt or my gnome-terminal to disable this whitespace fill behavior?
Hopefully Thomas Dickey will correct me if I'm wrong, but I'm pretty
sure this has to do with the use of bkgdset() so that clrtoeol()
will set the proper background color all the way to the end of the
line.
Consider the case where you have a different default background
terminal color than what the user has specified in 'color body ...'.
Without the use of bkgdset(), you'd see the wrong color at the end
of each line.
The thing is, my mutt background is black as is my gnome-terminal
background. And as I said, a pager like less isn't using whitespace
fill which makes X copy/paste more convenient. Would it be reasonable
to add a config option to mutt so it just uses the hosting terminal
background?
Post by Michael Elkins
xterm has the 'trimSelection' option for this purpose, but
gnome-terminal doesn't seem to support it.
me
--
Will Fiveash
Michael Elkins
2010-08-07 18:35:56 UTC
Permalink
Post by Will Fiveash
The thing is, my mutt background is black as is my gnome-terminal
background. And as I said, a pager like less isn't using whitespace
fill which makes X copy/paste more convenient. Would it be reasonable
to add a config option to mutt so it just uses the hosting terminal
background?
Try editing config.h and changing:

#define HAVE_BKGDSET 1

to

#undef HAVE_BKGDSET

me
Will Fiveash
2010-08-07 18:52:57 UTC
Permalink
Post by Michael Elkins
Post by Will Fiveash
The thing is, my mutt background is black as is my gnome-terminal
background. And as I said, a pager like less isn't using whitespace
fill which makes X copy/paste more convenient. Would it be reasonable
to add a config option to mutt so it just uses the hosting terminal
background?
#define HAVE_BKGDSET 1
to
#undef HAVE_BKGDSET
What I see in my config.h is:
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */

so it doesn't appear to be defined.
--
Will Fiveash
Michael Elkins
2010-08-08 03:08:41 UTC
Permalink
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
Can you give me a recipe to reproduce what you are seeing? I just tried in
both xterm and gnome-terminal and I don't seem to be getting any extra padding
when I select text.

me
ubitux
2010-08-08 05:32:20 UTC
Permalink
Post by Michael Elkins
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
Can you give me a recipe to reproduce what you are seeing? I just
tried in both xterm and gnome-terminal and I don't seem to be
getting any extra padding when I select text.
me
Try with a terminal multiplexer such as screen, you should expect the
issue. Also, your #undef HAVE_BKGDSET seems to solve it just fine for me
:)

Is there a reason for not getting this by default?

About that problem, the FAQ tells to use the screen's bce option, but that
does not work really well…

Regards,
--
ubitux
Michael Elkins
2010-08-08 15:32:22 UTC
Permalink
Post by ubitux
Try with a terminal multiplexer such as screen, you should expect the
issue. Also, your #undef HAVE_BKGDSET seems to solve it just fine for me
:)
When using screen, I do see this behavior in both xterm and gnome-terminal.
Post by ubitux
Is there a reason for not getting this by default?
If you don't use bkgdset(), any time there is a non-default background color
used and the text does not reach the right column, the space from the end of
the text to the right column will be the background color rather than the
color the user requested.
Post by ubitux
About that problem, the FAQ tells to use the screen's bce option, but that
does not work really well

I put this in my ~/.screenrc:

defbce on
term screen-bce

and then the problem went away under both xterm and gnome-terminal.

What wasn't working when you tried it?

me
ubitux
2010-08-08 17:51:09 UTC
Permalink
Post by Michael Elkins
Post by ubitux
Try with a terminal multiplexer such as screen, you should expect the
issue. Also, your #undef HAVE_BKGDSET seems to solve it just fine for me
:)
When using screen, I do see this behavior in both xterm and gnome-terminal.
Post by ubitux
Is there a reason for not getting this by default?
If you don't use bkgdset(), any time there is a non-default
background color used and the text does not reach the right column,
the space from the end of the text to the right column will be the
background color rather than the color the user requested.
Post by ubitux
About that problem, the FAQ tells to use the screen's bce option, but that
does not work really well…
defbce on
term screen-bce
Mmmh sorry I may have screwed up a thing; yeah it works fine after a
re-test.

But it also seems some ncurses applications are able to handle that well,
without depending on special settings for the terminal multiplexer; take
irssi for example: it is able to display a whole line (even with a special
background color, default or not) without getting "copiable spaces
characters".

Maybe a workaround is possible with default settings (both mutt and
screen)?
Post by Michael Elkins
and then the problem went away under both xterm and gnome-terminal.
What wasn't working when you tried it?
me
--
ubitux
Cameron Simpson
2010-08-09 00:35:04 UTC
Permalink
On 07Aug2010 20:08, Michael Elkins <***@sigpipe.org> wrote:
| On Sat, Aug 07, 2010 at 01:52:57PM -0500, Will Fiveash wrote:
| >What I see in my config.h is:
| >/* Define if you have bkgdset, as a function or macro. */
| >/* #undef HAVE_BKGDSET */
| >
| >so it doesn't appear to be defined.
|
| Can you give me a recipe to reproduce what you are seeing? I just
| tried in both xterm and gnome-terminal and I don't seem to be
| getting any extra padding when I select text.

I do. It's actually been bugging me for a while.
Viewing your message above in mutt's internal pager and triple clicking
to select your lines I get the file attached (mutt-urxvt.txt); there is
space padding to the right hand edge of the terminal. There are still
newlines.

I attach mutt-v.txt, the "mutt -v" output.

I am using a Mac iTerm window with TERM=xterm-color.
Interestingly, in an xterm it doesn't happen.

Cheers,
--
Cameron Simpson <***@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Squidliness is next to DoDliness. - Ancient Tibetan Proverb
Michael Elkins
2010-08-09 04:42:07 UTC
Permalink
Post by Cameron Simpson
I do. It's actually been bugging me for a while.
Viewing your message above in mutt's internal pager and triple clicking
to select your lines I get the file attached (mutt-urxvt.txt); there is
space padding to the right hand edge of the terminal. There are still
newlines.
I attach mutt-v.txt, the "mutt -v" output.
I am using a Mac iTerm window with TERM=xterm-color.
Interestingly, in an xterm it doesn't happen.
Check 'infocmp xterm-color' and it is probably missing the "bce" attribute.

me
Michael Elkins
2010-08-09 05:20:35 UTC
Permalink
Post by Cameron Simpson
I do. It's actually been bugging me for a while.
Viewing your message above in mutt's internal pager and triple clicking
to select your lines I get the file attached (mutt-urxvt.txt); there is
space padding to the right hand edge of the terminal. There are still
newlines.
can you also paste what 'color' muttrc commands you are using? do you still
see the spaces with:

color normal default default?

me
Michael Elkins
2010-08-09 06:37:21 UTC
Permalink
This post might be inappropriate. Click to display it.
Michael Elkins
2010-08-08 17:27:34 UTC
Permalink
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
I'm not sure if this bug is similar to what you are seeing.

http://dev.mutt.org/trac/ticket/3392

I'm guessing you are not using ncurses given then lack of bkgdset.

me
Will Fiveash
2010-08-08 19:40:37 UTC
Permalink
Post by Michael Elkins
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
I'm not sure if this bug is similar to what you are seeing.
http://dev.mutt.org/trac/ticket/3392
I'm guessing you are not using ncurses given then lack of bkgdset.
I've been compiling with S-Lang instead of ncurses. There was some
reason I did that a while back but I can't remember it now so I will see
if I can get mutt to use ncurses.
--
Will Fiveash
Chip Camden
2010-08-08 19:49:18 UTC
Permalink
Post by Will Fiveash
Post by Michael Elkins
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
I'm not sure if this bug is similar to what you are seeing.
http://dev.mutt.org/trac/ticket/3392
I'm guessing you are not using ncurses given then lack of bkgdset.
I've been compiling with S-Lang instead of ncurses. There was some
reason I did that a while back but I can't remember it now so I will see
if I can get mutt to use ncurses.
--
Will Fiveash
256-color support, for one.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com | http://chipsquips.com
Will Fiveash
2010-08-08 20:06:38 UTC
Permalink
Post by Will Fiveash
Post by Michael Elkins
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
I'm not sure if this bug is similar to what you are seeing.
http://dev.mutt.org/trac/ticket/3392
I'm guessing you are not using ncurses given then lack of bkgdset.
I've been compiling with S-Lang instead of ncurses. There was some
reason I did that a while back but I can't remember it now so I will see
if I can get mutt to use ncurses.
I think I was using S-Lang because I could not find libncurses on
OpenSolaris (or maybe it was another reason, it has been a while) but I
took another look and found it installed in /usr/gnu/lib. I just
configured mutt with --with-curses=/usr/gnu and this appears to have
fixed the white space fill problem I was experiencing (I also had to set
LD_LIBRARY_PATH in mutt's environment so the runtime linker can find
libncurses). Thanks for your help.
--
Will Fiveash
Will Fiveash
2010-08-08 23:03:16 UTC
Permalink
Post by Will Fiveash
Post by Will Fiveash
Post by Michael Elkins
Post by Will Fiveash
/* Define if you have bkgdset, as a function or macro. */
/* #undef HAVE_BKGDSET */
so it doesn't appear to be defined.
I'm not sure if this bug is similar to what you are seeing.
http://dev.mutt.org/trac/ticket/3392
I'm guessing you are not using ncurses given then lack of bkgdset.
I've been compiling with S-Lang instead of ncurses. There was some
reason I did that a while back but I can't remember it now so I will see
if I can get mutt to use ncurses.
I think I was using S-Lang because I could not find libncurses on
OpenSolaris (or maybe it was another reason, it has been a while) but I
took another look and found it installed in /usr/gnu/lib. I just
configured mutt with --with-curses=/usr/gnu and this appears to have
fixed the white space fill problem I was experiencing (I also had to set
LD_LIBRARY_PATH in mutt's environment so the runtime linker can find
libncurses). Thanks for your help.
I will add however that when mutt is compiled to use the standard
/lib/libcurses in OpenSolaris mutt won't displaying color text however I
notice that vim will properly display color text using the same
libcurses and same terminal env. settings in a gnome-terminal. Any
thoughts as to why mutt isn't displaying color text with libcurses?

I've attached the gzipped config.log created when I configured mutt
using --with-curses=/lib.
--
Will Fiveash
Will Fiveash
2010-08-08 23:27:41 UTC
Permalink
Post by Will Fiveash
I've attached the gzipped config.log created when I configured mutt
using --with-curses=/lib.
Forgot to attach...
--
Will Fiveash
Loading...