Subject: bug#6741: 24.0.50; ansi-term: spurious newlines (soft linebreaks becomes had linebreak)

From: Noam Postavsky <[email-masked]>
Date: Tue, 30 Jan 2018 20:17:38 -0500

close 6741
quit

Sébastien Gross <[email-masked]> writes:

> I am currently using ansi-term as a terminal emulator. the problem is
> when lines are longer than the buffer column number a hard newline
> ('\n') is inserted.
> Thus when some text is copied (with using both the mouse or keyboard
> sequences) some spurious new line appear into the pasted text.
>
> For example in ansi-term type:
>
> echo "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor in cididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
>
> (this line is intentionally left long)
>
>
> If you try to copy/past  it (using the mouse selection and middle click)
> you might get something like (depending on term-window-width):
>
>
> echo "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiu
> smod tempor in cididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis n
> ostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
>
> As you can see hard newline appear.
>
>
> Is there a way to fix this ?

Well, it's a bit late, but the answer is yes:

      (setq term-suppress-hard-newline t)