mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 00:03:39 -05:00
Updated Examples (markdown)
11
Examples.md
11
Examples.md
@@ -577,8 +577,8 @@ _fzf_history_msys2() {
|
|||||||
local WORK_DIR="${TMPDIR:-/tmp}/${FUNCNAME[0]##_}-${UID:-$(id -u)}"
|
local WORK_DIR="${TMPDIR:-/tmp}/${FUNCNAME[0]##_}-${UID:-$(id -u)}"
|
||||||
mkdir -p "${WORK_DIR}" || return
|
mkdir -p "${WORK_DIR}" || return
|
||||||
|
|
||||||
# `builtin fc` does not work inside winpty, so run it here
|
# `builtin fc` does not work inside winpty correctly,
|
||||||
# to take output to a file.
|
# so run it here to take output to a file.
|
||||||
(set -o pipefail
|
(set -o pipefail
|
||||||
builtin fc -lnr -2147483648 |
|
builtin fc -lnr -2147483648 |
|
||||||
last_hist=$(HISTTIMEFORMAT='' builtin history 1) \
|
last_hist=$(HISTTIMEFORMAT='' builtin history 1) \
|
||||||
@@ -588,11 +588,10 @@ _fzf_history_msys2() {
|
|||||||
|
|
||||||
# stdin is passed to winpty as-is tty, and input/output
|
# stdin is passed to winpty as-is tty, and input/output
|
||||||
# to/from fzf is via file.
|
# to/from fzf is via file.
|
||||||
winpty -- bash -c "
|
winpty -- bash -c "set -o pipefail;
|
||||||
set -o pipefail
|
|
||||||
cat '${WORK_DIR}'/input | \
|
cat '${WORK_DIR}'/input | \
|
||||||
FZF_DEFAULT_OPTS='${FZF_OPTS}' fzf --query '${READLINE_LINE}' \
|
FZF_DEFAULT_OPTS='${FZF_OPTS}' fzf --query '${READLINE_LINE}' \
|
||||||
>'${WORK_DIR}'/output
|
>'${WORK_DIR}'/output
|
||||||
" || return
|
" || return
|
||||||
|
|
||||||
# Get fzf output from file.
|
# Get fzf output from file.
|
||||||
|
|||||||
Reference in New Issue
Block a user