tomrijndorp / vscode-finditfaster

Find it, but faster! Fast file search for VS Code.
MIT License
299 stars 29 forks source link

terminal stays open after search is selected #40

Closed AdamBD closed 10 months ago

AdamBD commented 1 year ago

After opening the search fucntion and selecting a result, when you open the terminal panel again in vscode it opens the finditfaster terminal. This is annoying because I want to go back to using an active terminal and need to open a new panel for this.

Is there anyway around this?

tomrijndorp commented 1 year ago

Hi @AdamBD, I just had a look through the VS Code API to see if anything changed since the last time I checked, but there's no way for extensions to control which terminal is focused (other than by creating one, which causes VS Code to trigger it). So unfortunately there's nothing that can be done to change this behavior.

sukhostavets commented 11 months ago

Hi, I also want to add this feature. I have ideas on how this could work, I'd be happy to work on it

Idea is to save vscode.window.activeTerminal when creating/opening terminal and .show() on success. Hiding terminal would be tricky, but making disposable event listener should help.

@tomrijndorp what do you think about that?

tomrijndorp commented 11 months ago

Thanks for letting me know @M-Sukhostavets! I think that makes sense. Had a quick look and it appears that the API is now sufficient to enable this kind of behavior. I'll add this when I have some cycles, there's another feature that I should remove at the same time. Will have a look and follow up here.

sukhostavets commented 11 months ago

I want to work on that, will create PR this week. Could you please review it after?

tomrijndorp commented 10 months ago

Alright, so this is now in, thanks @MykhailoSukhostavets! There are unfortunately some limitations in VS Code's API, which means the following aspects cannot be fixed as of now (unless I'm wrong)

That said, if your workflow is such that you basically always have have a terminal open, @MykhailoSukhostavets' will be very useful :) Happy holidays!