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

Open
opened 2026-01-31 07:52:58 +00:00 by claunia · 0 comments
Owner

Originally created by @mmseng on GitHub (May 16, 2024).

Originally assigned to: @lhecker on GitHub.

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. https://github.com/microsoft/terminal/pull/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 https://github.com/microsoft/terminal/issues/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>].

Originally created by @mmseng on GitHub (May 16, 2024). Originally assigned to: @lhecker on GitHub. ### 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. https://github.com/microsoft/terminal/pull/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 https://github.com/microsoft/terminal/issues/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>]`.
claunia added the Needs-TriageIssue-BugIn-PRNeeds-Attention labels 2026-01-31 07:52:59 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21717