Private Mode in Windows Terminal #7443

Closed
opened 2026-01-31 01:04:13 +00:00 by claunia · 17 comments
Owner

Originally created by @avdain on GitHub (Apr 16, 2020).

Description of the new feature/enhancement

Private mode ensures that when you close the Windows Terminal or a tab, all data is erased like saved commands.

Proposed technical implementation details (optional)

Originally created by @avdain on GitHub (Apr 16, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement **Private mode** ensures that when you close the **Windows Terminal** or a tab, **all data is erased like saved commands**. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
Author
Owner

@zadjii-msft commented on GitHub (Apr 16, 2020):

I mean, this isn't really something that the Terminal controls. Saving history is something that's entirely at the discretion of the shell application. This would have to be something that you'd configure with PsReadline (for powershell), or in your .bashrc for bash

Or you could just use cmd, it doesn't save history 😆

@zadjii-msft commented on GitHub (Apr 16, 2020): I mean, this isn't really something that the Terminal controls. Saving history is something that's entirely at the discretion of the shell application. This would have to be something that you'd configure with PsReadline (for powershell), or in your `.bashrc` for bash Or you could just use cmd, it doesn't save history 😆
Author
Owner

@avdain commented on GitHub (Apr 16, 2020):

@zadjii-msft The private mode feature should not only be available for one command line, but for all command lines. I'm sure that many Windows Terminal users want to use the private mode.

@avdain commented on GitHub (Apr 16, 2020): @zadjii-msft The private mode feature should not only be available for one command line, but for all command lines. I'm sure that many Windows Terminal users want to use the private mode.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 16, 2020):

It’s a good idea, but terminal cannot control if the shell saves its history to a file. This is because terminal can only understand text input and text output. Anything special that happens with the text is outside of Terminal’s control. Sorry!

@DHowett-MSFT commented on GitHub (Apr 16, 2020): It’s a good idea, but terminal cannot control if the shell saves its history to a file. This is because terminal can only understand text input and text output. Anything special that happens with the text is outside of Terminal’s control. Sorry!
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 16, 2020):

If it is possible, we would welcome your contribution.

@DHowett-MSFT commented on GitHub (Apr 16, 2020): If it is possible, we would welcome your contribution.
Author
Owner

@avdain commented on GitHub (Apr 17, 2020):

@Terminal0x02 Thank you very much, I agree with you. :)

@avdain commented on GitHub (Apr 17, 2020): @Terminal0x02 Thank you very much, I agree with you. :)
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 21, 2020):

Instead of using sock puppet accounts to continue to request this feature, you could contribute positively to the development of this project by making a proposal for how it could work! We accept reasonable specifications for feature requests, even if those feature requests are closed.

The reasons we don't think this is possible:

  • When you start powershell, or cmd, and then run "dir", here's what happens.
    • Terminal starts powershell.exe
    • Terminal sends d
    • Terminal sends i
    • Terminal sends r
    • Terminal sends <CR>
    • powershell receives d
    • powershell receives i
    • powershell receives r
    • powershell receives <CR>
    • powershell prints out the list of files in the current folder
    • terminal receives that list and puts it on the screen

Unfortunately, there's no space in here--in those letters, d, i, r, or <CR>--for Terminal to say "do not save this command".. right?

Terminal0x2 (who also appears to be you) said "it is possible." That's why I'm asking:
If there's a reasonable proposal that explains how this feature could be implemented, I will 100% believe that it is possible. I do not see how we could do it without the shell (powershell, cmd) actually doing the work.

It isn't reasonable to just say "it's possible" when you're the one asking for a feature and expect us to guess as to how you think it's possible.

@DHowett-MSFT commented on GitHub (Apr 21, 2020): Instead of using sock puppet accounts to continue to request this feature, you could contribute positively to the development of this project by making a proposal for how it could work! We accept reasonable specifications for feature requests, even if those feature requests are closed. The reasons we don't think this is possible: * When you start powershell, or cmd, and then run "dir", here's what happens. * Terminal starts powershell.exe * Terminal sends `d` * Terminal sends `i` * Terminal sends `r` * Terminal sends `<CR>` * powershell receives `d` * powershell receives `i` * powershell receives `r` * powershell receives `<CR>` * powershell prints out the list of files in the current folder * terminal receives that list and puts it on the screen Unfortunately, there's no space in here--in those letters, `d`, `i`, `r`, or `<CR>`--for _Terminal_ to say "do not save this command".. right? Terminal0x2 (who also appears to be you) said "it is possible." That's why I'm asking: If there's a reasonable proposal that explains how this feature could be implemented, I will 100% believe that it is possible. I do not see how we could do it without the shell (powershell, cmd) _actually doing the work_. It isn't reasonable to just say "it's possible" when you're the one asking for a feature and expect us to guess as to how you think it's possible.
Author
Owner

@avdain commented on GitHub (Apr 21, 2020):

Hello, @DHowett @zadjii-msft ,
I can tell you I had nothing to do with those accounts. If I can think of any ideas that would allow you to include private mode, I'd be happy to share them with you. :)

  • I can't answer the Microsoft team in time because I have exams to write and because I am busy in many areas.
@avdain commented on GitHub (Apr 21, 2020): Hello, @DHowett @zadjii-msft , I can tell you I had nothing to do with those accounts. If I can think of any ideas that would allow you to include private mode, **I'd be happy to share them with you.** **:)** - **I can't answer the Microsoft team in time because I have exams to write and because I am busy in many areas.**
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 21, 2020):

Thanks! If you have any ideas, we love to hear them. Good luck with your exams!

@DHowett-MSFT commented on GitHub (Apr 21, 2020): Thanks! If you have any ideas, we love to hear them. Good luck with your exams!
Author
Owner

@avdain commented on GitHub (Apr 21, 2020):

@DHowett Thank you very much! 😀

@avdain commented on GitHub (Apr 21, 2020): @DHowett Thank you very much! 😀
Author
Owner

@avdain commented on GitHub (May 4, 2020):

@DHowett-MSFT @zadjii-msft
The integration of the function of how CMD behaves on restart could also be integrated into Windows PowerShell.

@avdain commented on GitHub (May 4, 2020): @DHowett-MSFT @zadjii-msft The integration of the function of how **CMD** behaves on restart could also be integrated into **Windows PowerShell**.
Author
Owner

@DHowett-MSFT commented on GitHub (May 4, 2020):

CMD never saves its history, and everybody complains about this.

@DHowett-MSFT commented on GitHub (May 4, 2020): CMD never saves its history, and everybody complains about this.
Author
Owner

@avdain commented on GitHub (May 4, 2020):

The integration of the function of how CMD behaves on restart could also be integrated into Windows PowerShell.

By this I mean that the behavior of CMD can also be integrated into Windows PowerShell.

@avdain commented on GitHub (May 4, 2020): > The integration of the function of how CMD behaves on restart could also be integrated into Windows PowerShell. By this I mean that the behavior of CMD can also be integrated into Windows PowerShell.
Author
Owner

@DHowett-MSFT commented on GitHub (May 4, 2020):

The behavior of CMD is something everybody hates. We are not integrating it into Windows PowerShell.

@DHowett-MSFT commented on GitHub (May 4, 2020): _The behavior of CMD is something **everybody hates**. We are not integrating it into Windows PowerShell._
Author
Owner

@avdain commented on GitHub (May 4, 2020):

I don't mean the 100% behaviour of CMD, but only the behaviour how CMD deletes the history of executed commands after a restart.

@DHowett-MSFT - I respect your opinion.

@avdain commented on GitHub (May 4, 2020): I don't mean the **100%** behaviour of CMD, but only the behaviour **how CMD deletes the history of executed commands after a restart**. @DHowett-MSFT - **I respect your opinion.**
Author
Owner

@zadjii-msft commented on GitHub (May 4, 2020):

@qantex You know, instead of creating a whole slew of puppet accounts to repost this same issue over and over, you could have instead spent the 5 minutes it takes googling using your favorite search engine to find the configuration for this setting within powershell itself. Try:

Set-PSReadlineOption -HistorySaveStyle SaveNothing

From the docs:

-HistorySaveStyle

Specifies how PSReadLine saves history.

Valid values are as follows:

  • SaveIncrementally: Save history after each command is executed and share across multiple instances of PowerShell.
  • SaveAtExit: Append history file when PowerShell exits.
  • SaveNothing: Don't use a history file.
   
Type: HistorySaveStyle
Position: Named
Default value: SaveIncrementally
Accept pipeline input: False
Accept wildcard characters: False
@zadjii-msft commented on GitHub (May 4, 2020): @qantex You know, instead of creating a whole slew of puppet accounts to repost this same issue over and over, you could have instead spent the 5 minutes it takes ~~googling~~ _using your favorite search engine_ to find the configuration for this setting within powershell itself. Try: ```powershell Set-PSReadlineOption -HistorySaveStyle SaveNothing ``` [From the docs:](https://docs.microsoft.com/en-us/powershell/module/psreadline/set-psreadlineoption?view=powershell-7) ### `-HistorySaveStyle` Specifies how **PSReadLine** saves history. Valid values are as follows: * **SaveIncrementally**: Save history after each command is executed and share across multiple instances of PowerShell. * **SaveAtExit**: Append history file when PowerShell exits. * **SaveNothing**: Don't use a history file. &nbsp; | &nbsp; -- | -- Type: | HistorySaveStyle Position: | Named Default value: | SaveIncrementally Accept pipeline input: | False Accept wildcard characters: | False
Author
Owner

@avdain commented on GitHub (May 5, 2020):

@zadjii-msft I know that this setting can be changed with the command "Set-PSReadlineOption -HistorySaveStyle SaveNothing".
I have published this suggestion to make it easier for Windows Terminal users to change this setting directly in the Windows Terminal settings as a GUI version.

@avdain commented on GitHub (May 5, 2020): @zadjii-msft I know that this setting can be changed with the command "**`Set-PSReadlineOption -HistorySaveStyle SaveNothing`**". I have published this suggestion to make it easier for Windows Terminal users to change this setting directly in the Windows Terminal settings as a GUI version.
Author
Owner

@avdain commented on GitHub (May 5, 2020):

@zadjii-msft I have nothing to do with these accounts, which always contain the same suggestion for improvement.

@avdain commented on GitHub (May 5, 2020): @zadjii-msft I have nothing to do with these accounts, which always contain the same suggestion for improvement.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7443