Skip to content
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

Terminal does not remember session, opens with settings #17019

Closed
krzysdz opened this issue Apr 4, 2024 · 4 comments
Closed

Terminal does not remember session, opens with settings #17019

krzysdz opened this issue Apr 4, 2024 · 4 comments
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree.

Comments

@krzysdz
Copy link
Contributor

krzysdz commented Apr 4, 2024

Windows Terminal version

67ae9f6

Windows build number

10.0.19045.4170

Other Software

No response

Steps to reproduce

  1. Make sure that a default profile exists and Terminal is set up to open windows from previous sessions when started.
  2. Open at least 1 non-settings tab
  3. Close the window
  4. Open Terminal again

Expected Behavior

The Terminal opens with the same tabs that were open when the window was closed.

Actual Behavior

Always only the settings tab is opened.

2024-04-05.00-53-56.mp4

Probably related to #16998. The version that previously worked for me was 9f3dbab.
2bcbe6b works fine, so the bug was introduced in #16172.

@krzysdz krzysdz 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 4, 2024
Copy link

github-actions bot commented Apr 4, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@krzysdz
Copy link
Contributor Author

krzysdz commented Apr 4, 2024

The session is correctly restored if an older version (2bcbe6b) is closed and opened in the latest one (67ae9f6), so the problem is with saving session on close.

@lhecker
Copy link
Member

lhecker commented Apr 5, 2024

I apologize for the issue. We're currently hoping to fix this with #16914.

In the meantime you can hotfix it by commenting out these lines:

if (const auto& settings{ _rootPane->GetContent().try_as<SettingsPaneContent>() })
{
ActionAndArgs action;
action.Action(ShortcutAction::OpenSettings);
OpenSettingsArgs args{ SettingsTarget::SettingsUI };
action.Args(args);
state.args = std::vector{ std::move(action) };
}
else

The issue occurs because SettingsPaneContent is not a proper, projected WinRT class (it doesn't have a definition in an .idl file). Due to this, the try_as call fails. try_as calls QueryInterface and without a projection, SettingsPaneContent doesn't get an IID (interface ID). I checked and with cppwinrt there doesn't seem to be any way around defining it in an .idl file.

@DHowett DHowett added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree. Priority-1 A description (P1) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 5, 2024
@DHowett DHowett added this to the Terminal v1.21 milestone Apr 5, 2024
@krzysdz
Copy link
Contributor Author

krzysdz commented Apr 5, 2024

I've just built from dc4026d (#16914) and session restore works fine.

@krzysdz krzysdz closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree.
Projects
None yet
Development

No branches or pull requests

3 participants