Skip to content
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

Session cwd defaults to same as each session's first pane #477

Open
YodaEmbedding opened this issue Apr 18, 2023 · 1 comment
Open

Session cwd defaults to same as each session's first pane #477

YodaEmbedding opened this issue Apr 18, 2023 · 1 comment

Comments

@YodaEmbedding
Copy link

YodaEmbedding commented Apr 18, 2023

Expected:

New windows start in $HOME.

Actual:

prefix+c creates a window in the same working directory as the directory that the first pane was restored to.

@YorikSar
Copy link

YorikSar commented May 4, 2023

Came here to create an issue about this, and here it is, right at the top of the list.

It looks like this is caused by pane restore process checking if anything exists in https://github.com/tmux-plugins/tmux-resurrect/blob/master/scripts/restore.sh#L184-L202 and then calling new_session with first pane's $dir passed as -c to tmux new-session in https://github.com/tmux-plugins/tmux-resurrect/blob/master/scripts/restore.sh#L149-L151.

I usually fix it by calling ^b:attach -c <the actual default dir I want> after resurrect. We should probably be able to store this default directory for each in the state file and then restore it with tmux attach-session -c call after session creation.

YodaEmbedding added a commit to YodaEmbedding/dotfiles that referenced this issue Jun 22, 2023
tmux-plugins/tmux-resurrect#477

Workaround: keep the 0th window at home and ignore its existence.
Why 0? Because I have keybindings for 1, 2, 3, ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants