script: use %n at the end of default tstamp_fmt

Since we are only outputting time-stamps when they differ
ending it with a newline, interferes with the output less.
This commit is contained in:
Simon J. Gerraty 2022-03-10 09:42:55 -08:00
parent b163dcab27
commit 31fde97357
2 changed files with 4 additions and 2 deletions

View file

@ -131,8 +131,10 @@ If
does not contain any
.Ql %
characters, it indicates the default format:
.Ql %n@ %s [%Y-%m-%d %T]\ ,
.Ql %n@ %s [%Y-%m-%d %T]%n ,
which is useful for both tools and humans to read, should be used.
Note that time-stamps will only be output when different from the
previous one.
.El
.Pp
The script ends when the forked shell (or command) exits (a

View file

@ -91,7 +91,7 @@ static struct termios tt;
#ifndef TSTAMP_FMT
/* useful for tool and human reading */
# define TSTAMP_FMT "%n@ %s [%Y-%m-%d %T] "
# define TSTAMP_FMT "%n@ %s [%Y-%m-%d %T]%n"
#endif
static const char *tstamp_fmt = TSTAMP_FMT;
static int tflg;