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

Avoid passing commands through with the shift modifier #2031

Closed
wants to merge 1 commit into from
Closed

Avoid passing commands through with the shift modifier #2031

wants to merge 1 commit into from

Conversation

ellie-idb
Copy link

@ellie-idb ellie-idb commented Jul 19, 2019

Summary of the Pull Request

This change would enable keybinds like Ctrl+Shift+C or Ctrl+Shift+V to work, as they would be captured inadvertently, and sent as their respective escape sequences.

References

#2000

PR Checklist

  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed

Validation Steps Performed

Built Terminal on separate instance of Azure Pipelines, then validated that functionality (Ctrl+Shift+V/Ctrl+Shift+C) work as intended (which is, that they properly copy and paste)

This change would enable keybinds like Ctrl+Shift+C or Ctrl+Shift+V  to work, as they would not be captured inadvertently, and sent as their respective escape sequences.
@zadjii-msft
Copy link
Member

I'm almost certain this isn't the right fix. This would change the behavior of input in conhost.exe, not the Windows Terminal. Could you provide better explanation of why you're making this change at this location in the code? Will this regress any existing behavior?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 24, 2019
@ellie-idb
Copy link
Author

@zadjii-msft Typically, any control sequence (that is, ^C, ^D, etc) does not (and should not, you can test this with showkey -a on any terminal emulator in an Linux environment) require the use of the Shift key. No behavior should be regressed from this, and it's just intended to enable an extra layer of keybinding (i.e Ctrl+Shift+C, Ctrl+Shift+V)

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

However, this low-level input processor is shared between conhost and Windows Terminal. Should Shift be stripped off in the much higher-level TerminalControl layer?

@zadjii-msft
Copy link
Member

Aye, but there are already keybindings that work just fine in conhost on Ctrl+Shift+V and Ctrl+Shift+C.

Does this affect INPUT_RECORDs that are generated for console applications reading input with ReadConsoleInput?

This might be more correct for just the terminal portion of conhost, but I'm worried about the console bits of conhost regressing.

If this does change the behavior, we should probably add a test to cover it, since it's clearly not covered currently :P

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 15, 2019
@ghost
Copy link

ghost commented Aug 15, 2019

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 15, 2019
@ellie-idb
Copy link
Author

I believe this is already fixed higher up in the input chain (rather then directly at conhost), seemingly inadvertently with #2235
See:

auto bindings = _settings.KeyBindings();
if (bindings)
{
handled = bindings.TryKeyChord({
modifiers.IsCtrlPressed(),
modifiers.IsAltPressed(),
modifiers.IsShiftPressed(),
vkey,
});
}

@ellie-idb ellie-idb closed this Aug 15, 2019
@ghost ghost removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Aug 15, 2019
@ellie-idb ellie-idb deleted the patch-1 branch August 15, 2019 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants