Skip to content

Commit 7cbf06c

Browse files
committed
Display dev/test env in console prompt in blue instead of green
The combination of red and blue is more color-blind friendly than red and green. Discussion: rails#50796 (comment)
1 parent 0ea9748 commit 7cbf06c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

railties/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
For example, `MyApp` will displayed as `my-app` in the prompt.
1212
1313
Additionally, the environment name will be colorized when the environment is
14-
`development` (green), `test` (green), or `production` (red), if your
14+
`development` (blue), `test` (blue), or `production` (red), if your
1515
terminal supports it.
1616
1717
*Stan Lo*

railties/lib/rails/commands/console/console_command.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def start
5353
def colorized_env
5454
case Rails.env
5555
when "development"
56-
IRB::Color.colorize("dev", [:GREEN])
56+
IRB::Color.colorize("dev", [:BLUE])
5757
when "test"
58-
IRB::Color.colorize("test", [:GREEN])
58+
IRB::Color.colorize("test", [:BLUE])
5959
when "production"
6060
IRB::Color.colorize("prod", [:RED])
6161
else

railties/test/commands/console_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ def test_prompt_env_colorization
6262
app = build_app(nil)
6363
irb_console = Rails::Console.new(app).console
6464
red = "\e[31m"
65-
green = "\e[32m"
65+
blue = "\e[34m"
6666
clear = "\e[0m"
6767

6868
Rails.env = "development"
69-
assert_equal("#{green}dev#{clear}", irb_console.colorized_env)
69+
assert_equal("#{blue}dev#{clear}", irb_console.colorized_env)
7070

7171
Rails.env = "test"
72-
assert_equal("#{green}test#{clear}", irb_console.colorized_env)
72+
assert_equal("#{blue}test#{clear}", irb_console.colorized_env)
7373

7474
Rails.env = "production"
7575
assert_equal("#{red}prod#{clear}", irb_console.colorized_env)

0 commit comments

Comments
 (0)