microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.02k stars 8.23k forks source link

Support for redacting private/sensitive information #16421

Open StephenCleary opened 9 months ago

StephenCleary commented 9 months ago

Description of the new feature/enhancement

I'd like the ability to automatically mask sensitive information in terminal windows. Masking application output would be great; masking user input (e.g., passwords on command line) would be nice as well.

This would be useful when screen sharing, demos, and when recording screencasts.

Warp does this.

Proposed technical implementation details (optional)

Terminal needs to know what to mask. At the very least it should have a user-editable series of regexes to detect potentially sensitive information. Even better would be integration with GitHub's existing secret scanning code, masking anything that matches GitHub's token patterns.

Masked information could use a specific Unicode character (or one of a few similar Unicode characters), so it's as obvious as possible that the output was masked.

Ideally, copying a masked value would copy the original plaintext, so copy/paste works the same as it always does, ignoring the masking.

237dmitry commented 9 months ago

Like this?

Screenshot 2023-12-06 000442

zadjii-msft commented 9 months ago

I saw something like this a while back

image

from https://youtu.be/NxsaHxON350?si=af0dLmZVEYsIeJN-&t=503

and I thought it was genuinely super cool. Now admittedly, this is from a project where someone is writing their own shell, so they're able to parse all the output from the client app then change it to colored block-drawing characters before it even hits the Terminal, but I thought it was a super clever idea.

(this of course wouldn't work for a11y at all, but then presumably, you'd disable it if you use a screen reader)

also xlink #5916