Copying text from Mutt viewer also copies trailing space

mutt at raf.org mutt at raf.org
Wed Jan 2 04:32:10 UTC 2019


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



More information about the Mutt-users mailing list