tab-rs
tab-rs copied to clipboard
Inherit tab configuration when opening a sub-tab
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 I'd love to pick this one up too. I am not sure I fully understand the requirements.
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.