diff options
author | ed <ed@FreeBSD.org> | 2009-05-17 16:17:48 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-05-17 16:17:48 +0000 |
commit | 44192767f8719fd83e9431c4c886ef677eabb363 (patch) | |
tree | 164552ab04a2397c57a3619b0c682e0b78eaf02c /sys/kern/tty_info.c | |
parent | 69acbef6caa4bc0026ef1639c14b98ee11234ac9 (diff) | |
download | FreeBSD-src-44192767f8719fd83e9431c4c886ef677eabb363.zip FreeBSD-src-44192767f8719fd83e9431c4c886ef677eabb363.tar.gz |
Print an extra newline when not at the first column already.
This makes siginfo output look a lot better when pressing it the first
time when in sh(1), for example:
$ load: 0.00 cmd: sh 1945 [ttyin] 3.94r 0.00u 0.00s 0% 1960k
load: 0.00 cmd: sh 1945 [ttyin] 4.19r 0.00u 0.00s 0% 1960k
will now become:
$
load: 0.00 cmd: sh 1945 [ttyin] 3.94r 0.00u 0.00s 0% 1960k
load: 0.00 cmd: sh 1945 [ttyin] 4.19r 0.00u 0.00s 0% 1960k
Diffstat (limited to 'sys/kern/tty_info.c')
-rw-r--r-- | sys/kern/tty_info.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/tty_info.c b/sys/kern/tty_info.c index 8894fe7..d2b059c 100644 --- a/sys/kern/tty_info.c +++ b/sys/kern/tty_info.c @@ -230,7 +230,8 @@ tty_info(struct tty *tp) /* Print load average. */ load = (averunnable.ldavg[0] * 100 + FSCALE / 2) >> FSHIFT; - ttyprintf(tp, "load: %d.%02d ", load / 100, load % 100); + ttyprintf(tp, "%sload: %d.%02d ", tp->t_column == 0 ? "" : "\n", + load / 100, load % 100); if (tp->t_session == NULL) { ttyprintf(tp, "not a controlling terminal\n"); |