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

Add a parameter for --closeOnExit #16060

Open
htcfreek opened this issue Sep 29, 2023 · 14 comments · May be fixed by #16497
Open

Add a parameter for --closeOnExit #16060

htcfreek opened this issue Sep 29, 2023 · 14 comments · May be fixed by #16497
Assignees
Labels
Area-Commandline wt.exe's commandline arguments Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@htcfreek
Copy link

Description of the new feature/enhancement

You can sett e keep open parameter as parameter of the shell used. But if this Is dynamic (e.g. in PowerToys shell plugin) a global parameter for WT would be helpful.

This parameter should keeps the WT window open regardless of the choosen profile and its parameters.

Proposed technical implementation details (optional)

@htcfreek htcfreek added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Sep 29, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 29, 2023
@zadjii-msft
Copy link
Member

Sorry could you elaborate more/? What exactly do you mean by "keep open"? Like, "always on top"? Or do you mean something more like "keep running even after I've closed all windows"? Or something else entirely? I'm not sure I'm totally familiar with all the powertoys these days 😝

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 29, 2023
@htcfreek
Copy link
Author

htcfreek commented Sep 29, 2023

@zadjii-msft
What I mean is a wt.exe parameter like cmd /k or powershell -NoExit that works on all profiles regardless off the profile/shell.

Use case: Shell plugin of PT Run. The window should stay open to show the results. (Currently we need some tricks to keep the command results visible which lead to microsoft/PowerToys#28876.)

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 29, 2023
@zadjii-msft
Copy link
Member

Oh, so like, a wt command-line version of "closeOnExit":"never"?

@zadjii-msft zadjii-msft removed the Needs-Attention The core contributors need to come back around and look at this ASAP. label Sep 29, 2023
@htcfreek
Copy link
Author

Oh, so like, a wt command-line version of "closeOnExit":"never"?

yes

@zadjii-msft
Copy link
Member

Er, well, reading that closer, that might not be quite right. -NoExit isn't just "leave the window open after the command completes", it's "Return to the shell prompt after the command exits". I'm pretty confident that can't be done in a general-purpose way.

Like, for cmd.exe, that would be cmd.exe /k {{command}}, sure. But what if the user's commandline is set to ssh? What if it's just ping.exe 8.8.8.8? wsl.exe tmux -a?

If the goal is just to leave the output on the screen after the command exits, that's easy enough to add with --closeOnExit=never or whatever. But returning to the shell is probably impossible, without manually setting the commandline to something like cmd.exe /c {command} & {shell} (which I'm sure is fraught with string excaping nightmares and other edge cases).

@htcfreek
Copy link
Author

The main goal is to keep the window open for reading the output. So --closeOnExit=nerver or even much easier --keepWindowOpen is what we need.

@zadjii-msft zadjii-msft changed the title Global keepOpen parameter Add a parameter for --closeOnExit Oct 2, 2023
@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. Area-Commandline wt.exe's commandline arguments and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Oct 2, 2023
@zadjii-msft zadjii-msft added this to the Backlog milestone Oct 2, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 2, 2023
@github-project-automation github-project-automation bot moved this to Should be written in Terminal Walkthroughs Oct 2, 2023
@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Needs-Tag-Fix Doesn't match tag requirements labels Oct 2, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 2, 2023
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 4, 2023
@htcfreek
Copy link
Author

htcfreek commented Oct 15, 2023

@zadjii-msft
I would like to work on this. But for the next three weeks I have no time. So if you feel this is important, please tell me and assign it to someone else.

Regarding the dev env: How many disk space do I need? Are there any special requirements I need to take care on?

@zadjii-msft
Copy link
Member

Go for it! We're probably not going to get to this soon anyways.

RE: system reqs: Building cppwinrt code takes a lot of disk space for pch files. Last I checked, it was on the order of 20GB. I know that's a lot 😕 Otherwise, I'm pretty sure https://github.com/microsoft/terminal#prerequisites covers the rest

@htcfreek
Copy link
Author

htcfreek commented Oct 16, 2023

@zadjii-msft
You can assign me.

Then I think 60 - 80 GB should be enough free disk space hopefully.

@htcfreek
Copy link
Author

htcfreek commented Dec 17, 2023

@zadjii-msft

  1. Can you tell me how to get rid of these errors when opening the project in VS?
    image
  2. I have build the Open Console solution using the PowerShell commands. But how can I start WT.exe now for testing?
    buildOutput.txt

@davidegiacometti, I know that you have contributed code to WT in the past. Do you have an idea what is wrong/missing?

@davidegiacometti
Copy link
Contributor

Do you have the old .NET Framework SDK installed?
WindowsTerminal.UIA.Tests project targets .NET Framework 4.8

@htcfreek
Copy link
Author

Do you have the old .NET Framework SDK installed?
WindowsTerminal.UIA.Tests project targets .NET Framework 4.8

Do I need to install it in VS using the VS installer or can I download and install the sdk?

I tried to install the .Net 4.8 target release package on weekends without fixing the VS warning.

@davidegiacometti
Copy link
Contributor

I have the .NET 4.8 installed from VS

@htcfreek
Copy link
Author

@davidegiacometti , @zadjii-msft
I got it building and created my first WT PR. 🤩 I left some comments in the PR about not working things and some questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Commandline wt.exe's commandline arguments Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
Status: Should be written
4 participants
@zadjii-msft @davidegiacometti @htcfreek and others