Skip to content

Don't push the buffer contents into the scrollback on session restore #17274

@mmseng

Description

@mmseng

Windows Terminal version

Windows Terminal Preview Version: 1.21.1272.0

Windows build number

10.0.19045.0

Other Software

No response

Summary

I installed Windows Terminal Preview to make use of the new buffer restoration feature, noted as the first bullet here: https://github.com/microsoft/terminal/releases/tag/v1.21.1272.0 (i.e. #16598), but it doesn't seem to behave any differently than previous versions, out of the box. Not sure if the feature is broken, or I'm doing something wrong, or what.

While searching related issues, I saw #17179, but it seems to be related more to special cases while restoring after a reboot due to Windows updates. In my case, I can't get the functionality to work even under the simplest condition of manually closing and reopening Terminal.

Steps to reproduce

  1. Install Windows Terminal Preview Version: 1.21.1272.0 from the MS app store.
  2. Launch Terminal Preview.
  3. Ensure that Settings -> Startup -> When Terminal starts is set to Open windows from a previous session.
  4. Run some commands in a tab. In my case I'm just testing with a PowerShell 7 tab with no profile customizations and running Get-Process.
  5. Close Terminal Preview.
  6. Launch Preview.

Expected Behavior

Original tabs, titles, and contents are restored. In the example case, the single PowerShell 7 tab should have the output of the previously-run Get-Process command displayed in the buffer content, along with however much further buffer history is expected by this feature.

Actual Behavior

Original tabs and tab titles are restored (as in previous versions), but buffer contents are empty (as in previous versions).

Additional info

According to the release notes linked above:

Buffer snapshots are stored in human-readable (albeit UTF-16) VT-encoded text in your package's local state directory, next to your settings.

I do see a file named buffer_<guid>.txt alongside my settings.json and state.json files in the Terminal Preview installation's LocalState folder (where such a file doesn't exist in the production Terminal app's LocalState folder). And that file does contain the output of Get-Process, as expected. But It's apparently just not being pulled into Terminal on a restart. I even see a couple lines in the buffer file that look like [Restored <DateTime>].

Metadata

Metadata

Assignees

Labels

In-PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-AttentionThe core contributors need to come back around and look at this ASAP.Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions