Closed (fixed)
Project:
Drush
Component:
Miscellaneous
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 May 2009 at 16:19 UTC
Updated:
1 Oct 2009 at 14:40 UTC
Jump to comment: Most recent file
All my terminals are on white backgound, so the drush green or yellow output is almost unreadable.
I suggest the patch below :
cat drush.inc.yellow-on-black.patch
--- ./includes/drush.inc.bak 2009-05-11 18:16:27.000000000 +0200
+++ ./includes/drush.inc 2009-05-11 18:16:05.000000000 +0200
@@ -626,9 +626,10 @@
* False in case of an error or failed type, True in all other cases.
*/
function _drush_print_log($entry) {
- $red = "\033[31m\033[1m[%s]\033[0m";
- $yellow = "\033[1;33m\033[1m[%s]\033[0m";
- $green = "\033[0;33m\033[1m[%s]\033[0m";
+ // always on black background
+ $red = "\033[31;40m\033[1m[%s]\033[0m";
+ $yellow = "\033[1;33;40m\033[1m[%s]\033[0m";
+ $green = "\033[0;33;40m\033[1m[%s]\033[0m";
$log_level = (int) drush_get_context('DRUSH_VERBOSE', 0);
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drush.inc_.yellow-on-black.patch | 657 bytes | guidot |
Comments
Comment #1
dhbanes commentedThis doesn't belong here. Change your terminal's settings to make yellow darker or change your background color to black. What OS are you using? If you're on Windows using Putty, this is a simple settings change. I do it all the time to make dark blue lighter on black background. If you can't change the colors with your terminal emulator, get a better one.
Comment #2
dman commentedWell, it is a valid point, and one which will come up any time a designer tries to impose their arbitrary color choices upon someone who has a customizable UI. Surely years of working with CSS has taught us that you can't just just tell users to change their own browser preferences so it's set up the same way as the developer prefers it?
"You must change your terminal settings to be the same as mine" is not a good response. Terminal shells have been ultra-configurable for decades.
The proposed patch here just follows the spirit of the W3C guidelines that : If you are going to override a users preference for their foreground color, also ensure that the background color will be a suitable contrast!
I've tried some color coding in my extensions to drush myself. Even within my own environment this has bitten me :-B . Terminal colors are MADE to be customized - which is why my logins to localhost, dev box, and the several live shells I visit most often are configured to display different colors to instantly indicate where I am. I switch between black, white, blue, tan or red all the time. So even for a single developer, color codes on the commandline still need to be compatible with the environment they are used in.
This patch starts to address that. There may be other work-arounds, I don't know. But saying "use another terminal client" is not solving the issue.
Comment #3
jonhattan@dcaillibaud: so your patch puts black as background color for the colored message. Very nice :). I've copy-pasted your code colors and works nice. But if you want your patch to be commited I think you must attach it as a file, and be sure it works :)
I also use white as background color but I didn't mind about unreadable colors in drush. In addition to dman's words I'll add it is an accesibility issue (for some people reading against a black (or white) background is hard).
Comment #4
guidot commentedAttached patch against current HEAD.
Comment #5
jonhattanComment #6
moshe weitzman commentedThis looks pretty awful in my terminal, and thats what counts!
Just kidding. It does look garish though. I can deal. Committed.