Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make regions in term modes respect line wrapping?

When using a term mode derivative (like ansi-term or multi-term), I often want to select a region and copy it someplace else. If that region includes a line which wraps at the edge of the terminal window, pasting that region in another buffer always inserts a hard newline at the place where term wrapped the line. This means I often have to go back and clean up pasted text. Is there a way to avoid doing this? I tried both term-line-mode and term-char-mode; both do the same thing.

I do not want to write a yank hook which strips out all newlines, since I want to preserve existing hard newlines in the original content.

like image 840
gcv Avatar asked Jul 01 '14 18:07

gcv


1 Answers

This works for me:

(setq term-suppress-hard-newline t)
like image 152
zwy Avatar answered Oct 07 '22 15:10

zwy