Did some research, hope it is not duplicate... Is there functionality (some shortcut maybe?) to break searching? Because when you develop a project, you often need to search stuff across all files. No problem here, until you actually have project with like many many files. For example, if you have project where node_modules are not ignored in search (since even there you sometimes need to search stuff) or you have some internal directory with internal builds, you get like too many results and you are not able to break search to specify search more closely or to just get rid of searching. Usually ends up with crash of vscode...
Version 0.10.6 (0.10.6)
You can, expand search details ("...") and specify a glob pattern what to include.
@bpasero i think this is a feature request to stop a long search operation in the workbench. sometimes you don't want to exclude files/folders and/or you end up doing a search that takes a lot of time that you want to cancel.
@chrisdias thank you :+1: exactly what I asked for
You can press ESC key to cancel a search or start another search to stop the previous one.
thanks @bpasero I didn't know this! Perhaps we can add some indication to the search area to give folks a clue they can press ESC?
CC @stevencl @bgashler1

To discuss in UX.
One solution would be to put a placeholder into the search box, just not sure about the text to put:

Ok guys @bpasero @joaomoreno, I suggest to reopen this.
Version: 0.10.11 (0.10.11)
Build: f291f4ad600767626b24a4b15816b04bee9a3049
In order to cancel search, you need to focus input (which is not really clear, ESC is not working in area below the input) and also if you search and project has many files, its hard to cancel search since search will take too many resources and its almost impossible to focus input.
@huttarichard while you are performing a long search, where are you usually focused? (Are you opening files that come up while you're searching, for instance?)
@bpasero if we made ESC a global keybinding to cancel searching while Search is running, is that doable?
If the user is focused on element that would normally have behavior associated with the ESC key (e.g. ESC key while focused on the Output would close the Output), could we first cause the ESC key to cancel the search and then afterward return it to its default behavior for whatever you are focused on?
@bgashler1
Are you opening files that come up while you're searching, for instance?
exactly! usually got results before search is done. So for me almost every time I start typing and searching is still in progress...
@huttarichard I believe using the ESC as a global hotkey to cancel search (only while search is running) may address your issue. Do you have any reservations about that?
@bgashler1 not at all! Great idea.
One problem with this though is if you want the Esc key to close something else, such as a peek window that you might have opened in the editor. Imagine you kick off a long search, look at one of the results inside a file, inspect references to a function using peek reference, then press Esc expecting to close the peek window. It could be quite frustrating if the search was cancelled instead.
Perhaps we need to consider a unique global keybinding instead to close the search since Esc is used to close other UI in context.
@stevencl good point. And maybe some clear visual affordance somewhere.
@bgashler1 @stevencl maybe better idea would be to just let ESC to do job in input and in area below (where search results are) and add button above input with esc-like functionality.
In order to cancel search, you need to focus input (which is not really clear, ESC is not working in area > below the input) and also if you search and project has many files, its hard to cancel search since > search will take too many resources and its almost impossible to focus input.
I don't get this, how does the number of results in a search make it hard to focus the search input field?
@bgashler1 @stevencl maybe better idea would be to just let ESC to do job in input and in area below (where search results are) and add button above input with esc-like functionality.
that sounds reasonable
@bpasero
I don't get this, how does the number of results in a search make it hard to focus the search input field?
Search results have nothing to do with this. Long running search will take lot of CPU, and you are not able to do almost anything after while (~ 10sec) including focus. And even if you had CPU to move around it is not exactly clear that you need focus in order to cancel search.
I actually try to press ESC many times with long running search before I opened this issue and functionality with ESC was already implemented, but didn't work for me. Now I know why...
We run the search not within the same process so I am actually curious why you see such a slowdown on your system that would prevent you from clicking into the search input.
Sorry for late answer. I might have overreacted, its not that bad, I run search again on MacBook Pro, it took about 40% CPU during the search. Its alright if you don't have open any other development tools (not my case). Anyway, I still believe that, area below should work with ESC.
I pushed that change.
Awesome! Thanks @bpasero
Most helpful comment
You can press ESC key to cancel a search or start another search to stop the previous one.