diff --git a/Examples.md b/Examples.md index 6b1e7ba..7fe6350 100644 --- a/Examples.md +++ b/Examples.md @@ -577,8 +577,8 @@ _fzf_history_msys2() { local WORK_DIR="${TMPDIR:-/tmp}/${FUNCNAME[0]##_}-${UID:-$(id -u)}" mkdir -p "${WORK_DIR}" || return - # `builtin fc` does not work inside winpty, so run it here - # to take output to a file. + # `builtin fc` does not work inside winpty correctly, + # so run it here to take output to a file. (set -o pipefail builtin fc -lnr -2147483648 | last_hist=$(HISTTIMEFORMAT='' builtin history 1) \ @@ -588,11 +588,10 @@ _fzf_history_msys2() { # stdin is passed to winpty as-is tty, and input/output # to/from fzf is via file. - winpty -- bash -c " - set -o pipefail + winpty -- bash -c "set -o pipefail; cat '${WORK_DIR}'/input | \ - FZF_DEFAULT_OPTS='${FZF_OPTS}' fzf --query '${READLINE_LINE}' \ - >'${WORK_DIR}'/output + FZF_DEFAULT_OPTS='${FZF_OPTS}' fzf --query '${READLINE_LINE}' \ + >'${WORK_DIR}'/output " || return # Get fzf output from file.