aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/tty_info.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-05-17 16:17:48 +0000
committerEd Schouten <ed@FreeBSD.org>2009-05-17 16:17:48 +0000
commit379affd5cb4fd639bddd1a2171f1a69805b4feb1 (patch)
tree164552ab04a2397c57a3619b0c682e0b78eaf02c /sys/kern/tty_info.c
parentdd970f41f746043123b283651b574eb70c8bce14 (diff)
downloadsrc-379affd5cb4fd639bddd1a2171f1a69805b4feb1.tar.gz
src-379affd5cb4fd639bddd1a2171f1a69805b4feb1.zip
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
Notes
Notes: svn path=/head/; revision=192252
Diffstat (limited to 'sys/kern/tty_info.c')
-rw-r--r--sys/kern/tty_info.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/tty_info.c b/sys/kern/tty_info.c
index 8894fe7808c5..d2b059ca41b0 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");