tmux new pane has home directory as default instead of previous directory
up vote
17
down vote
favorite
When I press Ctrl+" (create a new pane) while in a pane, which has the PWD
/tmp
for example, the new pane starts as my home folder ~
.
I looked at https://unix.stackexchange.com/a/109255/72471 and it helped me with the same issue concerning windows.
However, I couldn't fix the split-window
issue by inserting
bind " split-window -c "#{pane_current_path}"
into my ~/.tmux.conf
.
I am using tmux 1.9a and therefor don't want a rather messy solution for older versions stated here (it doesn't work in my case, anyway):
bind '"' set default-path "" ; split-window -v ; set -u default-path
How can I tell tmux
to set the default directory as the current path of a pane, when creating a new pane?
tmux
add a comment |
up vote
17
down vote
favorite
When I press Ctrl+" (create a new pane) while in a pane, which has the PWD
/tmp
for example, the new pane starts as my home folder ~
.
I looked at https://unix.stackexchange.com/a/109255/72471 and it helped me with the same issue concerning windows.
However, I couldn't fix the split-window
issue by inserting
bind " split-window -c "#{pane_current_path}"
into my ~/.tmux.conf
.
I am using tmux 1.9a and therefor don't want a rather messy solution for older versions stated here (it doesn't work in my case, anyway):
bind '"' set default-path "" ; split-window -v ; set -u default-path
How can I tell tmux
to set the default directory as the current path of a pane, when creating a new pane?
tmux
add a comment |
up vote
17
down vote
favorite
up vote
17
down vote
favorite
When I press Ctrl+" (create a new pane) while in a pane, which has the PWD
/tmp
for example, the new pane starts as my home folder ~
.
I looked at https://unix.stackexchange.com/a/109255/72471 and it helped me with the same issue concerning windows.
However, I couldn't fix the split-window
issue by inserting
bind " split-window -c "#{pane_current_path}"
into my ~/.tmux.conf
.
I am using tmux 1.9a and therefor don't want a rather messy solution for older versions stated here (it doesn't work in my case, anyway):
bind '"' set default-path "" ; split-window -v ; set -u default-path
How can I tell tmux
to set the default directory as the current path of a pane, when creating a new pane?
tmux
When I press Ctrl+" (create a new pane) while in a pane, which has the PWD
/tmp
for example, the new pane starts as my home folder ~
.
I looked at https://unix.stackexchange.com/a/109255/72471 and it helped me with the same issue concerning windows.
However, I couldn't fix the split-window
issue by inserting
bind " split-window -c "#{pane_current_path}"
into my ~/.tmux.conf
.
I am using tmux 1.9a and therefor don't want a rather messy solution for older versions stated here (it doesn't work in my case, anyway):
bind '"' set default-path "" ; split-window -v ; set -u default-path
How can I tell tmux
to set the default directory as the current path of a pane, when creating a new pane?
tmux
tmux
edited Apr 13 '17 at 12:37
Community♦
1
1
asked Jul 27 '14 at 12:47
polym
6,51643157
6,51643157
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
39
down vote
accepted
Try specifying v
for vertical or h
for horizontal
My .tmux.conf
file has:
bind split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
(I use and
-
as one-finger pane splitters.)
New panes open for me using my current directory, wherever I am.
It's certainly a key feature for me!
One other critical thing with tmux (this was the issue in this case) is that you have to apply changes with:
tmux source-file ~/.tmux.conf
Note that closing terminals, even logging off and restarting, will NOT apply tmux changes – you have to actually use that command (or use Ctrl+B :source-file ~/.tmux.conf
).
You can see my full .tmux.conf
file at https://github.com/durrantm/setups.
2
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
2
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Note that the same thing can be done fornew-window
– math2001
May 25 at 8:58
add a comment |
up vote
18
down vote
bind '%' split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
bind c new-window -c '#{pane_current_path}' # Create new window
Add last line to your ~/.tmux.conf
to maintain $PWD
in new window as well.
add a comment |
up vote
6
down vote
That's because,
bind " split-window -c "#{pane_current_path}"
should be
bind '"' split-window -c "#{pane_current_path}"
add a comment |
up vote
0
down vote
In case someone gets here by searching, this works fine with tmux 2.7 and should be ok with likely all versions
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
unbind %
bind % split-window -h -c '#{pane_current_path}' # Split panes horizontal
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
39
down vote
accepted
Try specifying v
for vertical or h
for horizontal
My .tmux.conf
file has:
bind split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
(I use and
-
as one-finger pane splitters.)
New panes open for me using my current directory, wherever I am.
It's certainly a key feature for me!
One other critical thing with tmux (this was the issue in this case) is that you have to apply changes with:
tmux source-file ~/.tmux.conf
Note that closing terminals, even logging off and restarting, will NOT apply tmux changes – you have to actually use that command (or use Ctrl+B :source-file ~/.tmux.conf
).
You can see my full .tmux.conf
file at https://github.com/durrantm/setups.
2
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
2
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Note that the same thing can be done fornew-window
– math2001
May 25 at 8:58
add a comment |
up vote
39
down vote
accepted
Try specifying v
for vertical or h
for horizontal
My .tmux.conf
file has:
bind split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
(I use and
-
as one-finger pane splitters.)
New panes open for me using my current directory, wherever I am.
It's certainly a key feature for me!
One other critical thing with tmux (this was the issue in this case) is that you have to apply changes with:
tmux source-file ~/.tmux.conf
Note that closing terminals, even logging off and restarting, will NOT apply tmux changes – you have to actually use that command (or use Ctrl+B :source-file ~/.tmux.conf
).
You can see my full .tmux.conf
file at https://github.com/durrantm/setups.
2
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
2
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Note that the same thing can be done fornew-window
– math2001
May 25 at 8:58
add a comment |
up vote
39
down vote
accepted
up vote
39
down vote
accepted
Try specifying v
for vertical or h
for horizontal
My .tmux.conf
file has:
bind split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
(I use and
-
as one-finger pane splitters.)
New panes open for me using my current directory, wherever I am.
It's certainly a key feature for me!
One other critical thing with tmux (this was the issue in this case) is that you have to apply changes with:
tmux source-file ~/.tmux.conf
Note that closing terminals, even logging off and restarting, will NOT apply tmux changes – you have to actually use that command (or use Ctrl+B :source-file ~/.tmux.conf
).
You can see my full .tmux.conf
file at https://github.com/durrantm/setups.
Try specifying v
for vertical or h
for horizontal
My .tmux.conf
file has:
bind split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
(I use and
-
as one-finger pane splitters.)
New panes open for me using my current directory, wherever I am.
It's certainly a key feature for me!
One other critical thing with tmux (this was the issue in this case) is that you have to apply changes with:
tmux source-file ~/.tmux.conf
Note that closing terminals, even logging off and restarting, will NOT apply tmux changes – you have to actually use that command (or use Ctrl+B :source-file ~/.tmux.conf
).
You can see my full .tmux.conf
file at https://github.com/durrantm/setups.
edited Feb 17 '17 at 20:37
G-Man
12.3k92961
12.3k92961
answered Jul 27 '14 at 12:52
Michael Durrant
15.6k44112180
15.6k44112180
2
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
2
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Note that the same thing can be done fornew-window
– math2001
May 25 at 8:58
add a comment |
2
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
2
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Note that the same thing can be done fornew-window
– math2001
May 25 at 8:58
2
2
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
You said "Note that closing terminals, even logging off and restarting will NOT apply tmux changes". Of course if you only detached tmux it won't but killing and restarting the server will apply changes :).
– soyuka
Feb 11 '15 at 19:16
2
2
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Thanks so much! This was super helpful. However, I'm pretty sure restarting the computer applies tmux changes :)
– vitiral
Oct 28 '15 at 16:52
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Restarting the computer did not apply changes for me previously leading to confusion for me. ymmv
– Michael Durrant
Feb 18 '17 at 13:40
Note that the same thing can be done for
new-window
– math2001
May 25 at 8:58
Note that the same thing can be done for
new-window
– math2001
May 25 at 8:58
add a comment |
up vote
18
down vote
bind '%' split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
bind c new-window -c '#{pane_current_path}' # Create new window
Add last line to your ~/.tmux.conf
to maintain $PWD
in new window as well.
add a comment |
up vote
18
down vote
bind '%' split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
bind c new-window -c '#{pane_current_path}' # Create new window
Add last line to your ~/.tmux.conf
to maintain $PWD
in new window as well.
add a comment |
up vote
18
down vote
up vote
18
down vote
bind '%' split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
bind c new-window -c '#{pane_current_path}' # Create new window
Add last line to your ~/.tmux.conf
to maintain $PWD
in new window as well.
bind '%' split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
bind c new-window -c '#{pane_current_path}' # Create new window
Add last line to your ~/.tmux.conf
to maintain $PWD
in new window as well.
answered Dec 4 '15 at 21:44
Shubham
18914
18914
add a comment |
add a comment |
up vote
6
down vote
That's because,
bind " split-window -c "#{pane_current_path}"
should be
bind '"' split-window -c "#{pane_current_path}"
add a comment |
up vote
6
down vote
That's because,
bind " split-window -c "#{pane_current_path}"
should be
bind '"' split-window -c "#{pane_current_path}"
add a comment |
up vote
6
down vote
up vote
6
down vote
That's because,
bind " split-window -c "#{pane_current_path}"
should be
bind '"' split-window -c "#{pane_current_path}"
That's because,
bind " split-window -c "#{pane_current_path}"
should be
bind '"' split-window -c "#{pane_current_path}"
answered Feb 19 '15 at 5:02
Giumo
7315
7315
add a comment |
add a comment |
up vote
0
down vote
In case someone gets here by searching, this works fine with tmux 2.7 and should be ok with likely all versions
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
unbind %
bind % split-window -h -c '#{pane_current_path}' # Split panes horizontal
add a comment |
up vote
0
down vote
In case someone gets here by searching, this works fine with tmux 2.7 and should be ok with likely all versions
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
unbind %
bind % split-window -h -c '#{pane_current_path}' # Split panes horizontal
add a comment |
up vote
0
down vote
up vote
0
down vote
In case someone gets here by searching, this works fine with tmux 2.7 and should be ok with likely all versions
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
unbind %
bind % split-window -h -c '#{pane_current_path}' # Split panes horizontal
In case someone gets here by searching, this works fine with tmux 2.7 and should be ok with likely all versions
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}' # Split panes vertically
unbind %
bind % split-window -h -c '#{pane_current_path}' # Split panes horizontal
answered Nov 26 at 13:46
ShahinSorkh
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f146825%2ftmux-new-pane-has-home-directory-as-default-instead-of-previous-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown