summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-03-13 22:46:53 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-03-13 22:59:23 +0900
commitc04e8de9b008428fee658e00661983ae22430435 (patch)
treefade292fa1ba34cc1a2bf3d3f3d32ffbb1f299c4 /shell
parent4977174deffb631207b90753c5d451fbe438ed18 (diff)
Make sure to start tmux pane from the current directory (#143)
- fzf-tmux - CTRL-T of bash/zsh/fish - fish implementation may not work if the path contains double-quote characters (FIXME)
Diffstat (limited to 'shell')
-rw-r--r--shell/key-bindings.bash2
-rw-r--r--shell/key-bindings.fish3
-rw-r--r--shell/key-bindings.zsh2
3 files changed, 4 insertions, 3 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index b7c79463..90112475 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -20,7 +20,7 @@ __fsel_tmux() {
else
height="-l $height"
fi
- tmux split-window $height "bash -c 'source ~/.fzf.bash; tmux send-keys -t $TMUX_PANE \"\$(__fsel)\"'"
+ tmux split-window $height "cd $(printf %q "$PWD");bash -c 'source ~/.fzf.bash; tmux send-keys -t $TMUX_PANE \"\$(__fsel)\"'"
}
__fcd() {
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index be39e3d5..ce1eea75 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -27,7 +27,8 @@ function fzf_key_bindings
function __fzf_ctrl_t
if [ -n "$TMUX_PANE" -a "$FZF_TMUX" != "0" ]
- tmux split-window (__fzf_tmux_height) "fish -c 'fzf_key_bindings; __fzf_ctrl_t_tmux \\$TMUX_PANE'"
+ # FIXME need to handle directory with double-quotes
+ tmux split-window (__fzf_tmux_height) "cd \"$PWD\";fish -c 'fzf_key_bindings; __fzf_ctrl_t_tmux \\$TMUX_PANE'"
else
__fzf_list | fzf -m > $TMPDIR/fzf.result
and commandline -i (cat $TMPDIR/fzf.result | __fzf_escape)
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index 84ba7302..6eb80839 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -22,7 +22,7 @@ if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then
else
height="-l $height"
fi
- tmux split-window $height "zsh -c 'source ~/.fzf.zsh; tmux send-keys -t $TMUX_PANE \"\$(__fsel)\"'"
+ tmux split-window $height "cd $(printf %q "$PWD");zsh -c 'source ~/.fzf.zsh; tmux send-keys -t $TMUX_PANE \"\$(__fsel)\"'"
}
else
fzf-file-widget() {