comparison src/channel.c @ 12311:66fa8eabbd6e v8.0.1035

patch 8.0.1035: sending buffer lines to terminal doesn't work on MS-Windows commit https://github.com/vim/vim/commit/ef68e4fa528165f8dd63156feeffc1af629b8d8a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 2 16:28:36 2017 +0200 patch 8.0.1035: sending buffer lines to terminal doesn't work on MS-Windows Problem: Sending buffer lines to terminal doesn't work on MS-Windows. Solution: Use CR instead of NL after every line. Make the EOF text work properly. Add the ++eof argument to :terminal.
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Sep 2017 16:30:04 +0200
parents e1f44e4afe67
children 44f3c9b7eec4
comparison
equal deleted inserted replaced
12310:bf16ab3c2341 12311:66fa8eabbd6e
1298 /* Need to make a copy to be able to append a NL. */ 1298 /* Need to make a copy to be able to append a NL. */
1299 if ((p = alloc(len + 2)) == NULL) 1299 if ((p = alloc(len + 2)) == NULL)
1300 return; 1300 return;
1301 memcpy((char *)p, (char *)line, len); 1301 memcpy((char *)p, (char *)line, len);
1302 1302
1303 for (i = 0; i < len; ++i) 1303 if (channel->ch_write_text_mode)
1304 if (p[i] == NL) 1304 p[len] = CAR;
1305 p[i] = NUL; 1305 else
1306 1306 {
1307 p[len] = NL; 1307 for (i = 0; i < len; ++i)
1308 if (p[i] == NL)
1309 p[i] = NUL;
1310
1311 p[len] = NL;
1312 }
1308 p[len + 1] = NUL; 1313 p[len + 1] = NUL;
1309 channel_send(channel, PART_IN, p, len + 1, "write_buf_line"); 1314 channel_send(channel, PART_IN, p, len + 1, "write_buf_line");
1310 vim_free(p); 1315 vim_free(p);
1311 } 1316 }
1312 1317