InPrivate Mode for Terminal #23180

Closed
opened 2026-01-31 08:34:35 +00:00 by claunia · 2 comments
Owner

Originally created by @upintheairsheep on GitHub (Apr 21, 2025).

There should be a mode in Windows Terminal that allows "inprivate tabs" of PowerShell or CMD to be used. This is helpful if your dealing with sensitive data within the terminal such as secret keys or passwords/logins, which could be stolen by malware or leaked during accidental showing of previously run commands, to avoid cluttering history if you are running tons of tiny commands that you'll only use once in order to maintain a clean and useful command log or avoid the chance of accidentally pressing "enter" adding it to the history when you’re running destructive or high-risk commands. Not an expert on Windows internals but you could set the command history txt to a temporary folder that will be deleted after the session ends in order to prevent leakage by malware.

Originally created by @upintheairsheep on GitHub (Apr 21, 2025). There should be a mode in Windows Terminal that allows "inprivate tabs" of PowerShell or CMD to be used. This is helpful if your dealing with sensitive data within the terminal such as secret keys or passwords/logins, which could be stolen by malware or leaked during accidental showing of previously run commands, to avoid cluttering history if you are running tons of tiny commands that you'll only use once in order to maintain a clean and useful command log or avoid the chance of accidentally pressing "enter" adding it to the history when you’re running destructive or high-risk commands. Not an expert on Windows internals but you could set the command history txt to a temporary folder that will be deleted after the session ends in order to prevent leakage by malware.
claunia added the Needs-TriageNeeds-Tag-FixResolution-Won't-Fix labels 2026-01-31 08:34:35 +00:00
Author
Owner

@lhecker commented on GitHub (Apr 22, 2025):

Essentially, we only spawn the commands that you specify through your profiles, or via the profiles we automatically generated for you. If there was a private mode, it would have to be a mode supported by the shell (PowerShell, Bash, etc.).

I believe for PowerShell the following issue would be relevant: https://github.com/PowerShell/PSReadLine/issues/2698

@lhecker commented on GitHub (Apr 22, 2025): Essentially, we only spawn the commands that you specify through your profiles, or via the profiles we automatically generated for you. If there was a private mode, it would have to be a mode supported by the shell (PowerShell, Bash, etc.). I believe for PowerShell the following issue would be relevant: https://github.com/PowerShell/PSReadLine/issues/2698
Author
Owner

@DHowett commented on GitHub (Apr 23, 2025):

Alas, as Leonard alludes to there isn't a global mode that we can enable for this.

If you want, you can probably add a special powershell profile that disables the recording of history.

The commandline would look something like...

powershell -noexit -c Set-PSReadLineOption -HistorySaveStyle SaveNothing
@DHowett commented on GitHub (Apr 23, 2025): Alas, as Leonard alludes to there isn't a global mode that we can enable for this. If you want, you can probably add a special powershell _profile_ that disables the recording of history. The commandline would look something like... ``` powershell -noexit -c Set-PSReadLineOption -HistorySaveStyle SaveNothing ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23180