summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/fzy-tmux2
-rw-r--r--fzy.14
-rw-r--r--src/fzy.c8
3 files changed, 11 insertions, 3 deletions
diff --git a/contrib/fzy-tmux b/contrib/fzy-tmux
index ba7c146..3ddf57b 100755
--- a/contrib/fzy-tmux
+++ b/contrib/fzy-tmux
@@ -23,7 +23,7 @@ main() {
fatal "Unable to create a temporary directory"
fi
- mkfifo "${PATH_FIFO_IN}" "${PATH_FIFO_OUT}"
+ mkfifo "${PATH_FIFO_IN}" "${PATH_FIFO_OUT}" "${PATH_FIFO_RET}"
export TMUX=$(_echo "${TMUX}" | cut -d , -f 1,2)
eval "tmux \
diff --git a/fzy.1 b/fzy.1
index 79dbad7..807b01b 100644
--- a/fzy.1
+++ b/fzy.1
@@ -41,6 +41,10 @@ Use QUERY as the initial search query.
Non-interactive mode. Print the matches in sorted order for QUERY to stdout.
.
.TP
+.BR \-0 ", " \-\-read-null
+Read input delimited by ASCII NUL characters.
+.
+.TP
.BR \-h ", " \-\-help
Usage help.
.
diff --git a/src/fzy.c b/src/fzy.c
index c2e5600..967a1fc 100644
--- a/src/fzy.c
+++ b/src/fzy.c
@@ -53,8 +53,12 @@ int main(int argc, char *argv[]) {
if (options.num_lines > choices.size)
options.num_lines = choices.size;
- if (options.num_lines + 1 > tty_getheight(&tty))
- options.num_lines = tty_getheight(&tty) - 1;
+ int num_lines_adjustment = 1;
+ if (options.show_info)
+ num_lines_adjustment++;
+
+ if (options.num_lines + num_lines_adjustment > tty_getheight(&tty))
+ options.num_lines = tty_getheight(&tty) - num_lines_adjustment;
tty_interface_t tty_interface;
tty_interface_init(&tty_interface, &tty, &choices, &options);