-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CmdLineArgs] "--keepOpen" to keep the window/tab/pane open after the process/profile has exited. #16497
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
@zadjii-msft
|
@zadjii-msft , @DHowett |
My apologies! I think this one slipped through the cracks while I was off being distracted writing sudo. I can try and take a spin through the review - though, I might be a little more brief than usual until after Build (May 21-23) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly the rest of this looks like it should work
You'll probably want |
This comment has been minimized.
This comment has been minimized.
The problem was a wrong parameter order. Correct order is |
This comment has been minimized.
This comment has been minimized.
// We try to read the setting from the command line arguments | ||
if (const auto& settings{ _cache.TryLookup(_profile) }) | ||
{ | ||
const auto closeMode = settings.DefaultSettings().CloseOnExit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zadjii-msft
I have updated the code to handle the command line setting now. But it doesn't work because closeMode
is always the value from Profile settings and never the updated value after command line parsing. How can I get the updated value that I manipulate in the command line parser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened issue #17473.
@zadjii-msft
What is happening here? |
Summary of the Pull Request
Adding a parameter to wt.exe that stops WT from closing after the sub process has exited.
References and Relevant Issues
Detailed Description of the Pull Request / Additional comments
This PR add the command line argument
--keepOpen
(short:-o
) that stops WT from closing after the sub process has exited. This is done by overriding theProfile termination behavior
setting at runtime withNever
.The new parameter is implemented as new-tab parameter and supports to be written to/read from a command line arguments JSON file.
Validation Steps Performed
wt.exe --keepOpen ping.exe learn.microsoft.com
wt.exe --keepOpen cmd.exe /c echo "test"
wt.exe -o cmd.exe /c echo "test"
wt.exe new-tab --keepOpen PowerShell -c Get-Service
wt.exe nt -p "Command Prompt" --keepOpen
wt.exe nt -p "PowerShell" --keepOpen
wt.exe nt -p "Windows PowerShell" -o
wt.exe -p "Command Prompt" ; split-pane -p "PowerShell" --keepOpen
wt.exe -p "Command Prompt" ; split-pane -p "PowerShell" -o
wt.exe --keepOpen -p "Command Prompt" ; split-pane -p "PowerShell"
wt.exe new-tab --keepOpen PowerShell --appendCommandLine -- Write-Host test
wt.exe new-tab -o PowerShell --appendCommandLine -- Write-Host test
PR Checklist
--closeOnExit
#16060