summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-04 22:15:54 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-04 22:15:54 +0100
commit1d97db3d987c05af88c30ad20f537bcf3024f9c1 (patch)
tree2835145bad19eeca6d90bd3360b12f8ffd2f9d4b /src/channel.c
parent327e6dd82235d70f6d5aa33ac8281e7fd79b7381 (diff)
patch 8.2.5056: the channel log only contains some of the raw terminal outputv8.2.5056
Problem: The channel log only contains some of the raw terminal output. Solution: Add the "o" flag to log all terminal output. Use it for "--log".
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index e3b32eebf8..abd2ce1da0 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -152,7 +152,8 @@ static proftime_T log_start;
void
ch_logfile(char_u *fname, char_u *opt)
{
- FILE *file = NULL;
+ FILE *file = NULL;
+ char *mode = "a";
if (log_fd != NULL)
{
@@ -163,9 +164,14 @@ ch_logfile(char_u *fname, char_u *opt)
fclose(log_fd);
}
+ // The "a" flag overrules the "w" flag.
+ if (vim_strchr(opt, 'a') == NULL && vim_strchr(opt, 'w') != NULL)
+ mode = "w";
+ ch_log_output = vim_strchr(opt, 'o') != NULL ? LOG_ALWAYS : FALSE;
+
if (*fname != NUL)
{
- file = fopen((char *)fname, *opt == 'w' ? "w" : "a");
+ file = fopen((char *)fname, mode);
if (file == NULL)
{
semsg(_(e_cant_open_file_str), fname);