Skip to content

Terminal tab terminates along with the initial process even if there are other active tasks in that console #10501

@alabuzhev

Description

@alabuzhev

Windows Terminal version (or Windows build number)

1.9.1445.0

Other Software

No response

Steps to reproduce

  1. Compile the following simple program:
#include <windows.h>

int main()
{
	STARTUPINFOW si{ sizeof(si) };
	PROCESS_INFORMATION pi{};

	if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe", {}, {}, {}, false, 0, {}, {}, &si, &pi))
		return 1;

	CloseHandle(pi.hThread);
	CloseHandle(pi.hProcess);

	return 0;
}
  1. Go to the Terminal settings, + Add a new profile, + New empty profile, and set Command line to the compiled exe.
  2. Try to open that profile.

Expected Behavior

The tab should remain active after the initial process exits since there are other active tasks still attached to that particular console.

Actual Behavior

It closes immediately.

Additional details

The problem was initially observed in a more complex scenario, where an app performs a self-update by launching the updater helper process in the same console and exiting. The helper then does its magic, restarts the original program and exits, providing a smooth user experience.

Needless to say that it works and always worked in conhost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalConnectionIssues pertaining to the terminal<->backend connection interfaceIssue-BugIt either shouldn't be doing this or needs an investigation.Priority-2A description (P2)Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions