tmux is showing zsh for vim with `pane_current_command`
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
For some reason Tmux is showing zsh
when it should be showing vim
for the output of #pane_current_command
, this is screwing up my vim aware pane moving commands in tmux which rely on it working correctly:
# vim aware commands
# pane/split switching
bind -n C-h run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" #left
bind -n C-j run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" #down
bind -n C-k run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" #up
bind -n C-l run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" #right
bind -n C- run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys 'C-\') || tmux select-pane -l" #next
# pane/split creation
bind | run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys v) || tmux split-window -h" #verticle
bind - run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys s) || tmux split-window -v" #horizontal
# pane/split close
bind x run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys q) || tmux kill-pane "
I'm starting vim via an alias:
alias vim='rbenv only -r 2.3.5 -c "/usr/local/bin/vim" $@'
it is indeed the alias the causing the issue, How do I fix this, is there any way to set the name of the current process?
I found jobs -Z
but that doesn't seem to work for an alias.
bash vim tmux
add a comment |Â
up vote
0
down vote
favorite
For some reason Tmux is showing zsh
when it should be showing vim
for the output of #pane_current_command
, this is screwing up my vim aware pane moving commands in tmux which rely on it working correctly:
# vim aware commands
# pane/split switching
bind -n C-h run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" #left
bind -n C-j run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" #down
bind -n C-k run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" #up
bind -n C-l run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" #right
bind -n C- run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys 'C-\') || tmux select-pane -l" #next
# pane/split creation
bind | run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys v) || tmux split-window -h" #verticle
bind - run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys s) || tmux split-window -v" #horizontal
# pane/split close
bind x run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys q) || tmux kill-pane "
I'm starting vim via an alias:
alias vim='rbenv only -r 2.3.5 -c "/usr/local/bin/vim" $@'
it is indeed the alias the causing the issue, How do I fix this, is there any way to set the name of the current process?
I found jobs -Z
but that doesn't seem to work for an alias.
bash vim tmux
Not sure it can help, but I had a similar problem withmutt
a few days ago, and posted about it here.
â Rastapopoulos
Oct 20 '17 at 11:51
I'm just guessing but I imagine tmux just looks up the immediate child process withps
or by looking at/proc
files (in your case the child iszsh
andvim
is a "grandchild" process) and there's nothing you'll be able to do to change that short of hacking tmux code (or, in this example, invokingvim
directly, not through intermediate shell). Or write/find code that let's you customize process name from the process (I know it's possible) and wrap your zsh/vim invocation in that. (!!)
â B Layer
Oct 20 '17 at 15:01
1
BTW, I'm assumingrbenv
launches a subshell within which your command runs. That would explain the behavior you're seeing. Things might be better if instead it didexec
.
â B Layer
Oct 20 '17 at 15:12
Yeah, I think that's pretty much it as well, any idea on how to fix this?
â Thermatix
Oct 23 '17 at 7:27
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
For some reason Tmux is showing zsh
when it should be showing vim
for the output of #pane_current_command
, this is screwing up my vim aware pane moving commands in tmux which rely on it working correctly:
# vim aware commands
# pane/split switching
bind -n C-h run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" #left
bind -n C-j run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" #down
bind -n C-k run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" #up
bind -n C-l run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" #right
bind -n C- run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys 'C-\') || tmux select-pane -l" #next
# pane/split creation
bind | run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys v) || tmux split-window -h" #verticle
bind - run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys s) || tmux split-window -v" #horizontal
# pane/split close
bind x run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys q) || tmux kill-pane "
I'm starting vim via an alias:
alias vim='rbenv only -r 2.3.5 -c "/usr/local/bin/vim" $@'
it is indeed the alias the causing the issue, How do I fix this, is there any way to set the name of the current process?
I found jobs -Z
but that doesn't seem to work for an alias.
bash vim tmux
For some reason Tmux is showing zsh
when it should be showing vim
for the output of #pane_current_command
, this is screwing up my vim aware pane moving commands in tmux which rely on it working correctly:
# vim aware commands
# pane/split switching
bind -n C-h run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" #left
bind -n C-j run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" #down
bind -n C-k run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" #up
bind -n C-l run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" #right
bind -n C- run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys 'C-\') || tmux select-pane -l" #next
# pane/split creation
bind | run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys v) || tmux split-window -h" #verticle
bind - run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys s) || tmux split-window -v" #horizontal
# pane/split close
bind x run "(tmux display-message -p '#pane_current_command' | grep -iq vim && tmux send-keys C-w && tmux send-keys q) || tmux kill-pane "
I'm starting vim via an alias:
alias vim='rbenv only -r 2.3.5 -c "/usr/local/bin/vim" $@'
it is indeed the alias the causing the issue, How do I fix this, is there any way to set the name of the current process?
I found jobs -Z
but that doesn't seem to work for an alias.
bash vim tmux
edited Oct 23 '17 at 9:21
asked Oct 20 '17 at 11:24
Thermatix
19918
19918
Not sure it can help, but I had a similar problem withmutt
a few days ago, and posted about it here.
â Rastapopoulos
Oct 20 '17 at 11:51
I'm just guessing but I imagine tmux just looks up the immediate child process withps
or by looking at/proc
files (in your case the child iszsh
andvim
is a "grandchild" process) and there's nothing you'll be able to do to change that short of hacking tmux code (or, in this example, invokingvim
directly, not through intermediate shell). Or write/find code that let's you customize process name from the process (I know it's possible) and wrap your zsh/vim invocation in that. (!!)
â B Layer
Oct 20 '17 at 15:01
1
BTW, I'm assumingrbenv
launches a subshell within which your command runs. That would explain the behavior you're seeing. Things might be better if instead it didexec
.
â B Layer
Oct 20 '17 at 15:12
Yeah, I think that's pretty much it as well, any idea on how to fix this?
â Thermatix
Oct 23 '17 at 7:27
add a comment |Â
Not sure it can help, but I had a similar problem withmutt
a few days ago, and posted about it here.
â Rastapopoulos
Oct 20 '17 at 11:51
I'm just guessing but I imagine tmux just looks up the immediate child process withps
or by looking at/proc
files (in your case the child iszsh
andvim
is a "grandchild" process) and there's nothing you'll be able to do to change that short of hacking tmux code (or, in this example, invokingvim
directly, not through intermediate shell). Or write/find code that let's you customize process name from the process (I know it's possible) and wrap your zsh/vim invocation in that. (!!)
â B Layer
Oct 20 '17 at 15:01
1
BTW, I'm assumingrbenv
launches a subshell within which your command runs. That would explain the behavior you're seeing. Things might be better if instead it didexec
.
â B Layer
Oct 20 '17 at 15:12
Yeah, I think that's pretty much it as well, any idea on how to fix this?
â Thermatix
Oct 23 '17 at 7:27
Not sure it can help, but I had a similar problem with
mutt
a few days ago, and posted about it here.â Rastapopoulos
Oct 20 '17 at 11:51
Not sure it can help, but I had a similar problem with
mutt
a few days ago, and posted about it here.â Rastapopoulos
Oct 20 '17 at 11:51
I'm just guessing but I imagine tmux just looks up the immediate child process with
ps
or by looking at /proc
files (in your case the child is zsh
and vim
is a "grandchild" process) and there's nothing you'll be able to do to change that short of hacking tmux code (or, in this example, invoking vim
directly, not through intermediate shell). Or write/find code that let's you customize process name from the process (I know it's possible) and wrap your zsh/vim invocation in that. (!!)â B Layer
Oct 20 '17 at 15:01
I'm just guessing but I imagine tmux just looks up the immediate child process with
ps
or by looking at /proc
files (in your case the child is zsh
and vim
is a "grandchild" process) and there's nothing you'll be able to do to change that short of hacking tmux code (or, in this example, invoking vim
directly, not through intermediate shell). Or write/find code that let's you customize process name from the process (I know it's possible) and wrap your zsh/vim invocation in that. (!!)â B Layer
Oct 20 '17 at 15:01
1
1
BTW, I'm assuming
rbenv
launches a subshell within which your command runs. That would explain the behavior you're seeing. Things might be better if instead it did exec
.â B Layer
Oct 20 '17 at 15:12
BTW, I'm assuming
rbenv
launches a subshell within which your command runs. That would explain the behavior you're seeing. Things might be better if instead it did exec
.â B Layer
Oct 20 '17 at 15:12
Yeah, I think that's pretty much it as well, any idea on how to fix this?
â Thermatix
Oct 23 '17 at 7:27
Yeah, I think that's pretty much it as well, any idea on how to fix this?
â Thermatix
Oct 23 '17 at 7:27
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Ok, so after seeing the comment left by @B-Layer I created a simple bash function to replace the alias I was using that allows me to have my cake and eat it!
The function:
function vim()
cmd="exec /usr/local/bin/vim $@"
rbenv only -r $GLOBAL_RUB_VERSION -c "$cmd";
Now it allows me to start vim using rbenv only so it always starts with the same version of ruby that vim was compiled against. Now (the reason for this song and dance) YouCompleteMe won't ever complain/crash because I switched ruby versions.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Ok, so after seeing the comment left by @B-Layer I created a simple bash function to replace the alias I was using that allows me to have my cake and eat it!
The function:
function vim()
cmd="exec /usr/local/bin/vim $@"
rbenv only -r $GLOBAL_RUB_VERSION -c "$cmd";
Now it allows me to start vim using rbenv only so it always starts with the same version of ruby that vim was compiled against. Now (the reason for this song and dance) YouCompleteMe won't ever complain/crash because I switched ruby versions.
add a comment |Â
up vote
1
down vote
accepted
Ok, so after seeing the comment left by @B-Layer I created a simple bash function to replace the alias I was using that allows me to have my cake and eat it!
The function:
function vim()
cmd="exec /usr/local/bin/vim $@"
rbenv only -r $GLOBAL_RUB_VERSION -c "$cmd";
Now it allows me to start vim using rbenv only so it always starts with the same version of ruby that vim was compiled against. Now (the reason for this song and dance) YouCompleteMe won't ever complain/crash because I switched ruby versions.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Ok, so after seeing the comment left by @B-Layer I created a simple bash function to replace the alias I was using that allows me to have my cake and eat it!
The function:
function vim()
cmd="exec /usr/local/bin/vim $@"
rbenv only -r $GLOBAL_RUB_VERSION -c "$cmd";
Now it allows me to start vim using rbenv only so it always starts with the same version of ruby that vim was compiled against. Now (the reason for this song and dance) YouCompleteMe won't ever complain/crash because I switched ruby versions.
Ok, so after seeing the comment left by @B-Layer I created a simple bash function to replace the alias I was using that allows me to have my cake and eat it!
The function:
function vim()
cmd="exec /usr/local/bin/vim $@"
rbenv only -r $GLOBAL_RUB_VERSION -c "$cmd";
Now it allows me to start vim using rbenv only so it always starts with the same version of ruby that vim was compiled against. Now (the reason for this song and dance) YouCompleteMe won't ever complain/crash because I switched ruby versions.
edited Nov 18 '17 at 14:29
Jeff Schaller
32.1k849109
32.1k849109
answered Oct 23 '17 at 9:17
Thermatix
19918
19918
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399329%2ftmux-is-showing-zsh-for-vim-with-pane-current-command%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Not sure it can help, but I had a similar problem with
mutt
a few days ago, and posted about it here.â Rastapopoulos
Oct 20 '17 at 11:51
I'm just guessing but I imagine tmux just looks up the immediate child process with
ps
or by looking at/proc
files (in your case the child iszsh
andvim
is a "grandchild" process) and there's nothing you'll be able to do to change that short of hacking tmux code (or, in this example, invokingvim
directly, not through intermediate shell). Or write/find code that let's you customize process name from the process (I know it's possible) and wrap your zsh/vim invocation in that. (!!)â B Layer
Oct 20 '17 at 15:01
1
BTW, I'm assuming
rbenv
launches a subshell within which your command runs. That would explain the behavior you're seeing. Things might be better if instead it didexec
.â B Layer
Oct 20 '17 at 15:12
Yeah, I think that's pretty much it as well, any idea on how to fix this?
â Thermatix
Oct 23 '17 at 7:27