Skip to content

Commit

Permalink
jj-fzf: assert that bash supports interactive mode with readline editing
Browse files Browse the repository at this point in the history
Some bash builds reportedly lack interactive readline editing (Nix stdenv).

Signed-off-by: Tim Janik <[email protected]>
  • Loading branch information
tim-janik committed Dec 6, 2024
1 parent 2d09677 commit 3d0f14d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jj-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ gawk --version | grep -Fq 'GNU Awk' || die "failed to find 'gawk' in \$PATH (GNU
version0d() { gawk 'BEGIN{FPAT="[0-9]+"} {printf("%04d.%04d.%04d.%04d.%04d\n",$1,$2,$3,$4,$5);exit}' <<<" $* "; }
versionge() { test "$(version0d "$2")a" '<' "$(version0d "$1")b"; }
versionge "$(bash --version)" 5.1.16 || die "failed to find 'bash' version 5.1.16 in \$PATH"
[[ `set -o` =~ emacs ]] || die "the 'bash' executable lacks interactive readline support"
versionge "$(jj --version --ignore-working-copy)" 0.24 || die "failed to find 'jj' version 0.24.0 in \$PATH"
versionge "$(fzf --version)" 0.43 || die "failed to find 'fzf' version 0.43.0 in \$PATH" # 0.43.0 supports offset-up
sed --version 2>/dev/null | grep -Fq 'GNU sed' && gsed() { sed "$@"; } && export -f gsed ||
Expand Down

0 comments on commit 3d0f14d

Please sign in to comment.