看板 FB_bugs 關於我們 聯絡資訊
The following reply was made to PR bin/137647; it has been noted by GNATS. From: Justin Hibbits <jrh29@alumni.cwru.edu> To: bug-followup@freebsd.org, rivanr@gmail.com Cc: Subject: Re: misc/137647: ps output depends on terminals column width when piping or redirecting Date: Mon, 10 Aug 2009 18:49:57 -0400 This patch hasn't been tested with every possible tty, but it works with xterm, vc, and redirect. There is one caveat, it breaks "ps aux | less", if one wants a simple list. (Gmail isn't cooperating, so patch is inline). =================================================================== --- ps.c (revision 195790) +++ ps.c (working copy) @@ -187,6 +187,8 @@ if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0') termwidth = atoi(cols); + else if (!isatty(STDOUT_FILENO)) + termwidth = UNLIMITED; else if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"