Terminal: Private Mode in Windows Terminal

Created on 16 Apr 2020  路  17Comments  路  Source: microsoft/terminal

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)

Issue-Feature Needs-Tag-Fix Needs-Triage Product-Terminal Resolution-External

Most helpful comment

If it is possible, we would welcome your contribution.

All 17 comments

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 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.

It鈥檚 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鈥檚 control. Sorry!

If it is possible, we would welcome your contribution.

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

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.

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.

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

@DHowett Thank you very much! 馃榾

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

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

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.

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

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.

@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 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.

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

Was this page helpful?
0 / 5 - 0 ratings