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

closeTab warning (When more then one pane is open, moved from original) #7077

Closed

Conversation

Chips1234
Copy link
Contributor

@Chips1234 Chips1234 commented Jul 26, 2020

Please note that this is moved from the original, #5874 since that one's commits are a mess, I'm recreating it with a new fork and branch.

Summary of the Pull Request

Adds a dialog that warns the user when tab close is requested and more than one pane is open. The feature can be disabled in settings.
Close pane warning

References

Closes #5301

PR Checklist

Validation Steps Performed

Manual

Add a dialog and settings
@ghost ghost added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Jul 26, 2020
@github-actions
Copy link

New misspellings found, please review:

  • sclose
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect/alphabet.txt
.github/actions/spell-check/expect/expect.txt
.github/actions/spell-check/expect/web.txt"');
@ARGV=@expect_files;
my @stale=qw('"atg BKMK colo consoleaccessibility Dst emptybox FFF Filledbox fullcolor hyperlink IDefault minmax NRCS phsl popclip remoting rerendered ROWSTOSCROLL SCS shobjidl stdarg stddef stdlib terminalnuget Tofill unfocuses xab xb xbc xca xce xdd xffff "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect/7e82686650be85de342bfd283fdb6d656d6b9338.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"dst EMPTYBOX nrcs Remoting sclose Scs Shobjidl "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check/expect || echo '... you want to ensure .github/actions/spell-check/expect/7e82686650be85de342bfd283fdb6d656d6b9338.txt is added to your repository...'
✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

⚠️ The command is written for posix shells. You can copy the contents of each perl command excluding the outer ' marks and dropping any '"/"' quotation mark pairs into a file and then run perl file.pl from the root of the repository to run the code. Alternatively, you can manually insert the items...

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spell-check/dictionary/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spell-check/dictionary/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spell-check/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spell-check/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The :check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

⚠️ Reviewers

At present, the action that triggered this message will not show its ❌ in this PR unless the branch is within this repository.
Thus, you should make sure that this comment has been addressed before encouraging the merge bot to merge this PR.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of transparency, I'm going to keep this one blocked for the same reason I blocked the original PR:

I think before this merges I want to have a resolution of how a setting to disable this would work. I've discussed this a bit more in #6549 (comment), but not really taken to any conclusions. I don't think that you need to be the person to implement all the appropriate settings, but I want to make sure that we've got our eye on that before we merge this.

The code here is super straightforward and I'd sign off, but I want to make sure there's a plan for how the settings will work in the future.

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 27, 2020
@Chips1234
Copy link
Contributor Author

I did implement a Globalappsetings Boolean just like the warning with close all tab dialog

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 27, 2020
@Chips1234
Copy link
Contributor Author

However, if you always want to be prompted I guess we can create a new issue for it (since the current Boolean cannot support that)

@Chips1234
Copy link
Contributor Author

Chips1234 commented Jul 27, 2020

@zadjii-msft We could possibly add a second boolean setting: "alwaysWarnCloseTab". But for now, there is a setting to disable this.

@Chips1234
Copy link
Contributor Author

Chips1234 commented Aug 14, 2020

@zadjii-msft Can you please review this? For always warning when close tab, I think that is something for a separate pr

@zadjii-msft
Copy link
Member

As I mentioned before, I want to make sure there's a plan here for the actual settings here before signing off. The code in this PR isn't all that tricky, but I'm worried that we'll get the necessary approvals from other team members and auto-merge this without a plan. So I'm blocking on the "make a plan" element of this PR first and foremost.

@Chips1234
Copy link
Contributor Author

But you can block this dialog from appearing in settings. Look at my commit. @zadjii-msft

@zadjii-msft
Copy link
Member

I'm more concerned about making sure that we have a comprehensive plan for all the future variants of this scenario. I don't want to just slap another setting in there that'll make it harder for us to have a comprehensive solution to all the scenarios in #6549

@microsoft-github-updates microsoft-github-updates bot changed the base branch from master to main October 22, 2020 00:27
@DHowett
Copy link
Member

DHowett commented Jul 20, 2023

Thank you so much for working on this! We've chosen to take the project in a slightly different direction, and make sure that this feature is fully specified before we commit to it. We'd love to have you back, of course, in the future! 😄

@DHowett DHowett closed this Jul 20, 2023
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-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

closeTab should present a confirmation dialog
3 participants