Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 444610

Summary: sys-apps/openrc output is unfriendly on high resolution/wide monitors
Product: Gentoo Hosted Projects Reporter: Aidan Marks <aidanamarks>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: CONFIRMED ---    
Severity: normal CC: patrick
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Package list:
Runtime testing required: ---
Attachments: Patch for rc-status
Cleaned up rc-status patch
New patch, now detecting terminals properly

Description Aidan Marks 2012-11-24 19:46:03 UTC
I have a 2560x1600 30 inch monitor and it is difficult to actually see what the service status is because the service is on the left and the status (started/stopped/crashed etc) is right justified way over on the other side of the screen with nothing in between.  Even on smaller screens it is somewhat difficult to read too.

A perfect example is rc-status output.  Perhaps limit the terminal width of the output or put some dots or periodic dots across the line so you can follow without having to highlight the line (if a mouse is available) or run grep and guess what service to grep for.

Interestingly, when doing a rc-status | grep [service] the output is close together, i.e. the service status is not right justified.  But again, you need to know what service you should be grepping for, so you start guessing because it is hard to see.

Unfortunately there is no rc-status nerd knob to show me in the current runlevel, what services are stopped, which is how this request got started.  

Though this is more a general request, as it would affect bootup output as well.

Reproducible: Always
Comment 1 William Hubbs gentoo-dev 2013-03-31 17:21:48 UTC
*** Bug 463962 has been marked as a duplicate of this bug. ***
Comment 2 Patrick Lauer gentoo-dev 2013-04-01 03:55:14 UTC
From the dupe'd bug:

I suggest an output change similar to the way debian does it: put the [ OK ] / [FAIL] output to the left of the rest so that there is less distance between the status indicator and the service.

* Blah starting up < -- 150 characters distance -- > [ OK ]

[ OK ] * Blah starting up
Comment 3 Patrick Lauer gentoo-dev 2013-10-29 09:20:48 UTC
Created attachment 362194 [details, diff]
Patch for rc-status

First draft of a patch, quite ugly but works
Comment 4 Patrick Lauer gentoo-dev 2013-10-30 08:16:37 UTC
Created attachment 362282 [details, diff]
Cleaned up rc-status patch

Now with proper pipe detection
Comment 5 Patrick Lauer gentoo-dev 2013-10-31 05:35:36 UTC
Created attachment 362340 [details, diff]
New patch, now detecting terminals properly

This fixes pipe/terminal detection.
In addition there's a second newline printed for eend to avoid output clobbering (which is not a clean solution, but fixes some output glitches)
Comment 6 Patrick Lauer gentoo-dev 2013-10-31 06:35:51 UTC
Another approach: Limit terminal width to 80 char
Not sure if that is what users expect, but it avoids the infinitely wide lines

@@ -805,6 +816,9 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
        cols = get_term_columns(fp) - (strlen(msg) + 5);
+       /*  limit output width */
+       if (cols > 80)
+               cols = 80;
        /* cons25 is special - we need to remove one char, otherwise things
         * do not align properly at all. */