diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2016-04-24 13:32:33 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-04-24 13:32:33 +0900 |
| commit | c727ba1d992acfb175adb273a89729d3df2fd9b0 (patch) | |
| tree | 06d0ab5376eaf2294a9e415134dfde7675455d13 /bin | |
| parent | bb70923cd8526620f7ba4a356344b87434ac483f (diff) | |
| download | fzf-c727ba1d992acfb175adb273a89729d3df2fd9b0.tar.gz | |
[fzf-tmux] Do not split pane if the height is too small
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/fzf-tmux | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/fzf-tmux b/bin/fzf-tmux index c1dfe53c..8b04c5ba 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -8,6 +8,7 @@ skip="" swap="" close="" term="" +[ -n "$LINES" ] && lines=$LINES || lines=$(tput lines) while [ $# -gt 0 ]; do arg="$1" case "$arg" in @@ -60,7 +61,7 @@ while [ $# -gt 0 ]; do if [[ "$arg" =~ ^.l ]]; then [ -n "$COLUMNS" ] && max=$COLUMNS || max=$(tput cols) else - [ -n "$LINES" ] && max=$LINES || max=$(tput lines) + max=$lines fi size=$(( max - size )) [ $size -lt 0 ] && size=0 @@ -82,7 +83,7 @@ while [ $# -gt 0 ]; do shift done -if [ -z "$TMUX" ]; then +if ! [ -n "$TMUX_PANE" -a $lines -gt 15 ]; then fzf "${args[@]}" exit $? fi |
