tab-rs icon indicating copy to clipboard operation
tab-rs copied to clipboard

Inherit tab configuration when opening a sub-tab

Open austinjones opened this issue 3 years ago • 2 comments

Once you've been using tab for a while, it's common to need a new tab for temporary use (e.g. myrepo/quick-task). You may have an existing workspace tab defined for myrepo with a working directory or env config.

Look at defining some kind of inheritance for this case, if an existing workspace tab is defined.

austinjones avatar Nov 24 '20 21:11 austinjones

@austinjones I'd love to pick this one up too. I am not sure I fully understand the requirements.

casonadams avatar Dec 20 '20 22:12 casonadams

Hey @casonadams, Sure! This one will be pretty cool I think.

So, the idea is that you'd often have some kind of configuration for mytab/ - with some working dir/config. Sometimes you need a quick throw-away tab for some task (e.g. mytab/git). Right now, tab will initialize the new selection with your current working directory.

Tab already checks whether the tab is running on the daemon here: https://github.com/austinjones/tab-rs/blob/a66a07cc5a6155be516c5174b81bb2827a220fb8/tab-command/src/service/create_tab.rs#L42

Below in create_named, if the exact match is none, it should fall back (could use Option::or) to the most specific prefix match (e.g. you are asking for a/b/c/, so a/ and a/b/ would match, but a/b/ would be selected). By setting workspace_tab, all the shell/env/etc from the YAML config will be used for the new tab.

austinjones avatar Dec 21 '20 00:12 austinjones