terminal icon indicating copy to clipboard operation
terminal copied to clipboard

wt new-tab --no-focus, to keep the focus in the current tab rather than the new tab

Open KalleOlaviNiemitalo opened this issue 1 year ago • 3 comments

Description of the new feature/enhancement

Add to wt new-tab an option that makes it keep the focus in the current tab, instead of switching to the new tab. I think --no-focus would be a good name for the new option, and consistent with the focus-tab command.

I'd use this in a Bash alias that starts a console application that takes some time to initialize. So I'd be able to continue working in the shell while the application is initializing, and switch to the application's tab a bit later.

Proposed technical implementation details (optional)

KalleOlaviNiemitalo avatar Jun 21 '24 10:06 KalleOlaviNiemitalo

This sounds interesting! Thank you for submitting this.

We have some concerns about how this would interact with some other commandline arguments (like split pane), so we are going to put this on the backlog and mark it as requiring a spec.

PankajBhojwani avatar Jun 26 '24 21:06 PankajBhojwani

I don't understand the concern about split pane. new-tab and split-pane are separate commands and don't have to support all the same options.

KalleOlaviNiemitalo avatar Jun 27 '24 16:06 KalleOlaviNiemitalo

They may not have to, but they should. They're both different localities for "make a new teminal control somewhere". split-pane focuses the new terminal, and if we're going to implement this for one type of "make-new-terminal" we should do it for all of them.

But then... should it be part of the action language as well? e.g. should you be able to bind Ctrl+Shift+B to open a new unfocused tab in the background?

What about new-window? Or the actions for moving a tab to a different window? Those all focus the new tab too... 🤔

DHowett avatar Jun 27 '24 17:06 DHowett

It doesn't sound like something hard to specify: whenever any action would actively move focus, it shouldn't.

Indeed, when interacting with other windows, it may become tricky, as the OS might automatically want to focus new windows (I don't know if that happens, but I can totally imagine it), but is it really a good reason to block all the low hanging fruits, like opening a new tab in the current window?

mkatch avatar Jan 02 '25 21:01 mkatch