Skip to content

Add another session option that prevents saving (or loading) buffer contents #18757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Reddimes opened this issue Apr 2, 2025 · 5 comments
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.

Comments

@Reddimes
Copy link

Reddimes commented Apr 2, 2025

Windows Terminal version

1.22.10731.0

Windows build number

10.0.26100

Other Software

No response

Steps to reproduce

Simply set the setting in Startup settings.
When Terminal Start: Open windows from a previous session

Image

Expected Behavior

One would expect this to recreate the same sessions you had open last time. You know, just fresh and clean new sessions like it used to. That is no longer the case.

Actual Behavior

This now saves the output from the last time the profile was open and makes everything look really messy and annoying. See attached screenshots.

The reason this is important to me is that I use Windows Terminal as a SSH Session Manager. I have a number of profiles available that simply launch an SSH session. Normally, it is not a huge deal for the SSH session to run in the background, but this makes it look ugly and disorganized.

Image
Image
Image

@Reddimes Reddimes added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 2, 2025
@Reddimes
Copy link
Author

Reddimes commented Apr 3, 2025

I tried editing permissions of %localappdata%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState to disallow creating new files. Then setting the permissions for elevated-state.json, state.json, and settings.json to allow modification. This does not fix the issue. It just ends the session entirely if I even try to save a setting change.

Edit:
I did go ahead and build a scheduled task to delete the buffer files in there every five minutes. I did disable it, because it is also annoying having a command prompt pop up every five minutes. I went ahead and completely removed write privileges for that directory(after "saving" a default state). I wish that it would still save what tabs I had open without doing any of the buffering, though. Am I missing a setting that will disable the buffer?

I checked the settings.json schema: https://aka.ms/terminal-profiles-schema and the help" https://aka.ms/terminal-documentation but could not find anything.

@Reddimes
Copy link
Author

Reddimes commented Apr 8, 2025

Now that I've disabled permissions to prevent this issue, I get a notification every time I launch that says it is lacking permissions. Of course it is lacking permissions to fix the buffering bug. This terminal history needs to be disabled. I want the terminal to save what sessions I had open the last time I opened it, but not display any of the buffered text. That could potentially be a security issue for connecting to SSH servers.

@DHowett
Copy link
Member

DHowett commented Apr 9, 2025

Thanks! Yes, this is definitely something we could do better.

We should introduce a third firstWindowPreference that affords for only restoring layouts (and no content.)


Beyond the main issue, your use case looks similar to #16303 (the ability to save and reload layouts). You may want to track that one as well.

@DHowett
Copy link
Member

DHowett commented Apr 9, 2025

FWIW, I am de-editorializing your title.

@DHowett DHowett changed the title Windows Terminal is restoring sessions and making everything incredibly ugly. Add another session option that prevents saving (or loading) buffer contents Apr 9, 2025
@DHowett DHowett added Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Area-Windowing Window frame, quake mode, tearout and removed Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 9, 2025
@DHowett DHowett added this to the Terminal v1.25 milestone Apr 9, 2025
@Reddimes
Copy link
Author

Reddimes commented Apr 9, 2025

FWIW, I am de-editorializing your title.

Haha. That is totally fair, I let my emotions write that title. My mistake, I'll own that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

2 participants