Commit Graph

86 Commits (d51980a3f50dfa8ce43b01a3dce216afb8a0bd8f)

Author SHA1 Message Date
Junegunn Choi b3b101a89c
Support binding of left-click and right-click
left-click and right-click are respectively bound to "ignore" and
"toggle" (after implicitly moving the cursor) by default.

Close #1130
7 years ago
Junegunn Choi e1582b8323
Clean up renderer code
Remove code that is no longer relevant after the removal of ncurses
renderer. This commit also fixes background color issue on tcell-based
FullscreenRenderer (Windows).
7 years ago
Junegunn Choi 7cfa6f0265
Fix custom foreground color inside preview window (addendum)
This fixes foreground color inside preview window when the text has ANSI
attributes except for foreground color.

Close #1046
7 years ago
Junegunn Choi dc55e68524
Remove unnecessary SCP (Save Cursor Position)
It is reported that it can have an unwanted side effect of clearing the
screen on terminal emulators that do not properly support it.

Patch suggested by @arya.

Close #1011
7 years ago
Junegunn Choi 39dbc8acdb
Exit 2 instead of panic when failed to open /dev/tty 7 years ago
Junegunn Choi 06301c7847
Fix regression: ANSI color in preview window not cleared 7 years ago
Junegunn Choi bc9d2abdb6
Improve preview window rendering
- Fix incorrect display of the last line when more than a line is
  wrapped above
- Avoid unnecessary flickering of the window
7 years ago
Junegunn Choi 6b5886c034
Adjust --no-clear option for repetitive relaunching
Related: https://gist.github.com/junegunn/4963bab6ace453f7f529d2d0e01b1d85

Close #974
7 years ago
Junegunn Choi 0c66521b23
Fix handling of bracketed paste mode
fzf should immediately continue consuming the buffer after discarding
bracketed paste mode sequence.

Close #951
7 years ago
Tw ab182e276b Use read syscall directly to get character (#931)
Due to go std lib uses poller for os.File introducing in this commit:
c05b06a12d
There are two changes to watch out:
1. os.File.Fd will always return a blocking fd except on bsd.
2. os.File.Read won't return EAGAIN error for nonblocking fd.

So
For 1, we just get tty's fd in advance and then set its block mode.
For 2, we use read syscall directly to get what we wanted error(EAGAIN).

Fix issue #910.

Signed-off-by: Tw <tw19881113@gmail.com>
7 years ago
Junegunn Choi d34e4cf698
Support CTRL-Z (SIGSTOP) 7 years ago
Junegunn Choi 6b592137b9
Add support for ctrl-alt-[a-z] key chords
Close #906
7 years ago
Junegunn Choi 6fd4be580b
Use alternate screen only when the value of height is 100%
Do not automatically decide to use alternate screen when the value of
height exceeds the height of the terminal.

    # Use alternate screen
    fzf
    fzf --height 100%
    fzf --no-height

    # Still use current screen
    fzf --height 10000
7 years ago
Junegunn Choi 53348feb89
Add --no-clear option 7 years ago
Junegunn Choi c82fb3c9b9
Add toggle-preview-wrap action 7 years ago
Junegunn Choi 21da02fac2
Fix indentation 7 years ago
Junegunn Choi 19569bd5c5
Move cursor to the top-left when returning to alternate screen
Fix broken preview border. Reported by Thomas Sattler.

    fzf --bind 'enter:execute(date)' --preview=date --reverse
7 years ago
Junegunn Choi 4b700192c1
Add --border option to draw horizontal lines above and below the finder
Goes well with --height
7 years ago
Junegunn Choi c95bb109c8
Suppress CSI codes in the output 8 years ago
Junegunn Choi dd156b59fc
Fix display issues with execute action
- Move cursor to the top-left corner when starting a command in
  alternate screen
- Fix cursor position when returning to alternate screen when fzf is
  running in full screen mode
8 years ago
Junegunn Choi 36dceecd58
Add support for ctrl-space key
Close #825
8 years ago
Junegunn Choi a3244c4892
Delete every line below the cursor 8 years ago
Junegunn Choi a5ad8fd3bd
Minor refactoring 8 years ago
Junegunn Choi deccdb1ec5
Cursor postition response can be preceded by user key strokes 8 years ago
Junegunn Choi 12a43b5e62
Disable mouse if failed to query cursor position 8 years ago
Junegunn Choi 6ccc12c332
Use alternate screen if --height needs the entire screen
- Remove unnecessary scrolling
- Allow us to use `--height 100%` under Neovim terminal for 24-bit colors

Related:
- #789
- https://github.com/neovim/neovim/issues/4151
8 years ago
Junegunn Choi 2a669e9a17
Clear lines even when background color is not set
Also revert the workaround in Vim plugin introduced in fa7c897.

Related: #814
8 years ago
Junegunn Choi ede7bfb901
Optimize LightRenderer for slow terminals 8 years ago
Junegunn Choi 03f5ef08c8
Use crypto/ssh/terminal instead of external stty command 8 years ago
Junegunn Choi d64828ce6d
Print error message to stderr on unexpected exit 8 years ago
Junegunn Choi 9977a3e9fc
Make preview renderer suspend early on line wrap 8 years ago
Junegunn Choi f8082bc53a
No need to use /bin/sh to execute stty and tput 8 years ago
Junegunn Choi 996dcb14a3
Make fzf immediately quit when failed to read /dev/tty
Close #798
8 years ago
Junegunn Choi 0c127cfdc1
No need to query row position of the cursor if mouse is disabled 8 years ago
Junegunn Choi 78a3f81972
Do not use \e[s and \e[u
Excerpt from http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html:

> - Save cursor position:
>   \033[s
> - Restore cursor position:
>   \033[u
>
> The latter two codes are NOT honoured by many terminal emulators. The
> only ones that I'm aware of that do are xterm and nxterm - even though
> the majority of terminal emulators are based on xterm code. As far as
> I can tell, rxvt, kvt, xiterm, and Eterm do not support them. They are
> supported on the console.

They are also unsupported by Neovim terminal.
8 years ago
Junegunn Choi 1448d631a7
Add --height option 8 years ago