diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-09-02 14:54:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-09-02 14:54:21 +0200 |
commit | 3346cc4ffb459ecddb97a8c19bcc5834afa4dead (patch) | |
tree | 0c911bd400c68687eafebf5d7be41df5cf67afe3 /src/channel.c | |
parent | 995e4afcfe60aa3c214ba680e7b027a4e05cf62b (diff) |
patch 8.0.1034: sending buffer lines to terminal doesn't work on MS-Windowsv8.0.1034
Problem: Sending buffer lines to terminal doesn't work on MS-Windows.
Solution: Send CTRL-D to mark the end of the text. (Yasuhiro Matsumoto,
closes #2043) Add the "eof_chars" option.
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c index b7a268a79a..94a762c610 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1417,6 +1417,13 @@ channel_write_in(channel_T *channel) in_part->ch_buf_top = lnum; if (lnum > buf->b_ml.ml_line_count || lnum > in_part->ch_buf_bot) { +#if defined(WIN32) && defined(FEAT_TERMINAL) + /* Send CTRL-D or "eof_chars" to close stdin on Windows. A console + * application doesn't treat closing stdin like UNIX. */ + if (channel->ch_job != NULL) + term_send_eof(channel); +#endif + /* Writing is done, no longer need the buffer. */ in_part->ch_bufref.br_buf = NULL; ch_log(channel, "Finished writing all lines to channel"); @@ -4626,6 +4633,22 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) return FAIL; } } + else if (STRCMP(hi->hi_key, "eof_chars") == 0) + { +# ifdef WIN3264 + char_u *p; + + if (!(supported2 & JO2_EOF_CHARS)) + break; + opt->jo_set2 |= JO2_EOF_CHARS; + p = opt->jo_eof_chars = get_tv_string_chk(item); + if (p == NULL) + { + EMSG2(_(e_invarg2), "term_opencmd"); + return FAIL; + } +# endif + } else if (STRCMP(hi->hi_key, "term_rows") == 0) { if (!(supported2 & JO2_TERM_ROWS)) |