DEV Community

Discussion on: Holding a loaded rifle without knowing it

Collapse
 
phallstrom profile image
Philip Hallstrom

While it doesn't cover all use cases one trick I've learned over the years is to setup different color schemes and prompts between your environments.

For example, all my local terminal windows are a dark theme. All of my production terminals are a light theme. This visually helps remind me I'm somewhere different.

The terminal prompts also change to include the environment itself. They are prefixed with EDGE, STAGING, and PRODUCTION. Colors change too. EDGE is in green, STAGING is in yellow, PRODUCTION is in red. You can do the same thing for irb/pry/rails-console prompts.

Even the website itself. For EDGE and STAGING, throw a banner/blammy across the top in a way that it doesn't affect the layout (float it on top something). Some bar with enough color and labeling to help remind you where you are. If you don't see that, you're in PRODUCTION.

None of this would stop me from doing something stupid, but it helps keep me aware of just where I am.