terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Conditional settings - i.e. different colors when Administrator

Open DavJenkins opened this issue 5 years ago • 2 comments

Description of the new feature/enhancement

As a user, it would be nice to be able to specify different color schemes based on some conditions.

For decades (ever since an errant recursive remove command executed as root) I have used light cyan on dark blue for normal command windows and bright white on red when I am operating as root or Administrator just to remind myself to be extra careful.

Proposed technical implementation details (optional)

This notion could be generalized as conditional profiles (or conditional attributes within a profile) to be applied when a specified expression evaluates to true. Conditional profiles (and/or attributes) would be guaranteed to be applied after all unconditional ones so they would override any default specifications, thus eliminating the need to add "else" or inverted duplicate conditionals. Order of evaluation/application of conditionals would be undefined (or, if you really want to get wild, they could be prioritized then undefined ordering among equal priorities).

When invoked as Administrator, any profile or attribute that was tagged as conditional based on having Administrator access would be applied; otherwise not. In my use case, any window I opened as me would be pleasantly colored while any window opened as Administrator would be "remember you're ROOT, stupid!" colored.

DavJenkins avatar Oct 18 '19 15:10 DavJenkins

This is related to #3062.

DHowett-MSFT avatar Oct 21 '19 19:10 DHowett-MSFT

In my dup https://github.com/microsoft/terminal/issues/14593 I added a proposal on how it would be implemented.

trajano avatar Jan 03 '23 20:01 trajano

Any new development on this? I also would really appreciate this.

mhechthz avatar Aug 09 '23 16:08 mhechthz

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? image That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

#11111 has also become a bit of a megathread tracking all these topics.

zadjii-msft avatar Aug 10 '23 13:08 zadjii-msft