summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-02-15 01:29:16 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-02-15 01:29:16 +0900
commit4396ab75487676f9d6281599a7392c922da62fa0 (patch)
treea296830597ff6ee9ee470b9b9e57973e56c49216
parent2b8c2b9f2af82d251a5929d08ba81cec25587487 (diff)
Do not set key bindings in non-interactive shell
-rwxr-xr-xinstall3
1 files changed, 3 insertions, 0 deletions
diff --git a/install b/install
index 82ad652c..c1513eb8 100755
--- a/install
+++ b/install
@@ -95,6 +95,8 @@ EOF
cat >> $src << "EOF"
# Key bindings
# ------------
+if [[ $- =~ i ]]; then
+
# Required to refresh the prompt after fzf
bind '"\er": redraw-current-line'
@@ -113,6 +115,7 @@ bind '"\C-t": " \C-u \C-a\C-k$(__fsel)\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er"'
# CTRL-R - Paste the selected command from history into the command line
bind '"\C-r": " \C-e\C-u$(HISTTIMEFORMAT= history | fzf +s | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
+fi
EOF
else
cat >> $src << "EOF"