-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: default working directory of new tmux splits to worktree repo #116
Comments
tmux's
you can make all splits inside a window open in the same directory. |
Thanks @junglerobba, that works great! I'll leave this issue open for now in case it seems like sensible default behaviour, but I'm happy for a maintainer to close it if not. |
I have the same problem/feature request. I usually have bare repos with many different worktrees and would like to be able to choose the worktree in the search list directly. If you don't want this as default behaviour this could be an --show-worktrees option or something. For example:
Then you would directly open the specific worktree and have the root folder for the tmux session be to the worktree you decided to work on. |
I really like this idea! I initially thought I wanted something adjacent to this, but this seems to be even better! 🤩 (I initially thought I wanted the ability to set the root folder for the tmux session to be a specific directory relative to the location of the bare repo root. Since I want to organize the structure of worktrees a particular way). To have a tmux session per worktree however seems much cleaner, and circumvents the need for such a feature. It would then need to include the project as well in the session switcher, since I'd usually want similar worktrees (eg. eg. filtering for
also, it seems like Here's also two aliases I have to follow the same structuring described in the link above. # new git project setup (using bare repos & worktrees)
# USAGE: repo githubusername/reponame
#
# new structure becomes:
# project
# ├── .bare
# ├── feature
# └── main
alias gclb='f(){ git clone --bare "$@" .bare }; f'
alias repo='f(){
mkdir -p "$HOME/Repos/$1";
cd "$HOME/Repos/$1";
gclb "[email protected]:$1.git";
echo "gitdir: ./.bare" > .git;
git worktree add main;
}; f' if this feature gets added, I guess it also makes sense to not default to opening multiple windows (one for each worktree) upon switching? (this is the same behaviour as |
When working with a bare Git repo and worktrees, tms opens a new window for each worktree. The working directory for the pane in each of those windows is the worktree directory. When splitting the window, the working directory for the new pane is the directory containing the bare repo (usually the parent of the worktree directory), not the worktree directory itself.
It'd be great if tms configured the tmux window so that a new pane's working directory is the worktree directory.
P.S. I'm a tmux noob, so not sure whether that's even possible 😅
P.P.S. Thanks for tms, it's great!
The text was updated successfully, but these errors were encountered: