-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
closeTab
should accept an index
param
#7180
Comments
Could you elaborate on it? I didn't catch why closetab should accept index parameter. you want to modify then, void TerminalPage::_HandleCloseTab(const IInspectable& /*sender*/,
const TerminalApp::ActionEventArgs& args)
{
if (const auto& realArgs = actionArgs.ActionArgs().try_as<TerminalApp::CloseTabArgs>())
{
uint32_t index = realArgs.Index(); // do you want to get it?
_CloseFocusedTab();
args.Handled(true);
}
} |
@KimKiHyuk Pretty much yea - except, it'll be more like how it's implemented in #7390. So the implementation would be more like: void TerminalPage::_HandleCloseTab(const IInspectable& /*sender*/,
const TerminalApp::ActionEventArgs& args)
{
if (const auto& realArgs = actionArgs.ActionArgs().try_as<TerminalApp::CloseTabArgs>())
{
if (realArgs.Index()) {
// The user provided an `index`
const auto index = realArgs.Index().Value();
const bool handled = _CloseTheNthTab(index); // TODO: This function would need to be implemented of course
args.Handled(handled);
}
else
{
// No index was provided - close the currently active tab.
_CloseFocusedTab();
args.Handled(true);
}
}
} |
## Summary of the Pull Request Updates the `closeTab` action to optionally take an index. ## PR Checklist * [x] Closes #7180 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [x] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: MicrosoftDocs/terminal#347 * [x] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Validation Steps Performed Added the following configuration to `settings.json` and validated both key combinations behaved as expected. Also opened the command palette and ensured that the actions were displayed. ```json { "command": "closeTab", "keys": "ctrl+shift+delete" }, { "command": { "action": "closeTab", "index": 0 }, "keys": "ctrl+shift+end" } ```
🎉This issue was addressed in #10447, which has now been successfully released as Handy links: |
Similar to the other closetab actions being introduced in #7176.
This is being tracked with the other support for customizing the new-tab dropdown, which will need the ability to specify and action for the "close tab" menu item
The text was updated successfully, but these errors were encountered: