Skip to content

Conversation

RhavoX
Copy link
Contributor

@RhavoX RhavoX commented Aug 3, 2020

The search command will now show the flyout and focus on the textbox. If the textbox has no focus and search command is used again it will focus the textbox.
A new command has been added to close the search flyout (escape by default) which can now be used to close it if the app has focus.
Previous behavior is somewhat odd compared to how nearly all other apps are handling it.

The search command will now show the flyout and focus on the textbox. If the textbox has no focus and search command is used again it will focus the textbox.
A new command has been added to close the search flyout (escape by default) which can now be used to close it.
@@ -283,6 +283,16 @@ public ICollection<KeyBinding> GetDefaultKeyBindings(Command command)
}
};

case Command.CloseSearch:
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we need an extra command for this. I think esc is intuitive enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I thought so too but the issue seems to be that when xterm.js has focus it "steals" keyboard processing. This was my quick idea to avoid this and still receive notifications about keypresses. Am I wrong? If so then do you have some other idea how to do this? :)

Copy link
Owner

Choose a reason for hiding this comment

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

After thinking about it I think we shouldn't care about escape if the search has no focus. Browser seem to handle it similar (escape is not closing the search if a textarea has focus)

But the other changes sound great 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked the browsers and also some IDEs and here is a summary.
These behave the way new implementation handled things (which is CTRL+F fires search/focuses if active, esc closes it regardless of focus):

  • Visual Studio 2019
  • VS Code
  • Chrome
  • Edge
  • Eclipse

Now here is a list of apps that don't care about the esc press when not in focus:

  • Firefox
    ;p

So as you can see the standard behavior of most advanced and well known apps which employ this feature is the one I've proposed. If you still think we can skip the esc part then I will remove it later. So what do you think? :)

Copy link
Owner

Choose a reason for hiding this comment

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

You convinced me 😄
Sorry for the long wait

@felixse felixse merged commit 6e3cfa6 into felixse:master Sep 27, 2020
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.

2 participants