Copying text from Mutt viewer also copies trailing space

2019-01-01 Thread Vegard Svanberg
Hi,

Happy New Year!

I have a problem that's been bugging me for years:

Let's say the terminal window is appr. 120 characters wide. The email
I'm reading is ~80 chars wide. In other words, columns 80-120 are blank.

When I copy text from Mutt into whatever else (vim, text editor, browser
textarea... doesn't matter), the paste includes the (trailing) spaces
(\s) from column 80-120, so I have to manually remove them.

This seems to only happen when I run Mutt inside screen or tmux.
However, I use screen/tmux extensively and I only observe this
phenomenon inside the Mutt viewer.

If I, say, edit the email so it opens in vim (like esc-e or hitting
reply), this does not occur.

How can I find out what causes this and (more importantly) fix it?

-- 
Vegard Svanberg  [*Takapa@IRC (EFnet)]



Re: Copying text from Mutt viewer also copies trailing space

2019-01-01 Thread Felix Finch
I just used X select to select two lines from your message, running inside 
tmux, and paste them into emacs.  It pasted in the two lines with no extraneous 
spaces on either line.  The selection highlighted the full width of both lines, 
210 columns.  I don't know what I am doing differently, but there are no 
extraneous spaces for me.

On 20190101, Vegard Svanberg wrote:
> Hi,
> 
> Happy New Year!
> 
> I have a problem that's been bugging me for years:
> 
> Let's say the terminal window is appr. 120 characters wide. The email
> I'm reading is ~80 chars wide. In other words, columns 80-120 are blank.
> 
> When I copy text from Mutt into whatever else (vim, text editor, browser
> textarea... doesn't matter), the paste includes the (trailing) spaces
> (\s) from column 80-120, so I have to manually remove them.
> 
> This seems to only happen when I run Mutt inside screen or tmux.
> However, I use screen/tmux extensively and I only observe this
> phenomenon inside the Mutt viewer.
> 
> If I, say, edit the email so it opens in vim (like esc-e or hitting
> reply), this does not occur.
> 
> How can I find out what causes this and (more importantly) fix it?

-- 
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
 Felix Finch: scarecrow repairman & wood chipper / fe...@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: Copying text from Mutt viewer also copies trailing space

2019-01-01 Thread mutt
Felix Finch wrote:

> On 20190101, Vegard Svanberg wrote:
> > Hi,
> > 
> > Happy New Year!
> > 
> > I have a problem that's been bugging me for years:
> > 
> > Let's say the terminal window is appr. 120 characters wide. The email
> > I'm reading is ~80 chars wide. In other words, columns 80-120 are blank.
> > 
> > When I copy text from Mutt into whatever else (vim, text editor, browser
> > textarea... doesn't matter), the paste includes the (trailing) spaces
> > (\s) from column 80-120, so I have to manually remove them.
> > 
> > This seems to only happen when I run Mutt inside screen or tmux.
> > However, I use screen/tmux extensively and I only observe this
> > phenomenon inside the Mutt viewer.
> > 
> > If I, say, edit the email so it opens in vim (like esc-e or hitting
> > reply), this does not occur.
> > 
> > How can I find out what causes this and (more importantly) fix it?
>
> I just used X select to select two lines from your message, running
> inside tmux, and paste them into emacs.  It pasted in the two lines
> with no extraneous spaces on either line.  The selection highlighted
> the full width of both lines, 210 columns.  I don't know what I am
> doing differently, but there are no extraneous spaces for me.

for me it happens when mutt is in tmux or screen in xterm,
pasting into gvim.

according to this, there isn't a solution:

  
https://stackoverflow.com/questions/28749919/text-copied-from-vim-inside-a-tmux-session-is-padded-with-spaces-to-the-right

according to this:

  
https://unix.stackexchange.com/questions/218248/trailing-spaces-when-copying-from-console

there's an xterm resource that will fix it:

  
https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:trimSelection

i just tested it and it fixes it in both screen and tmux.
yay! that's been bothering be a bit lately too. thanks for asking about it.

so, put this in a file like ~/.xresources.screen:

  XTerm*VT100.trimSelection: True

and cause this to be executed when you log into X11:

  xrdb -merge ~/.xresources.screen

cheers,
raf