diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2024-07-22 13:12:54 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-07-29 20:24:35 +0900 |
commit | e8a39eeb0fce97a35cf4e751c8b7a25552066b83 (patch) | |
tree | 2fb1bfaaa6590615c1de46204b5673ad4f620fc9 | |
parent | c790ab2024a7c4a2e3d7dd0d759080a4acbe9eff (diff) |
Ignore invalid byte sequence in UTF-8history-highlighted
-rw-r--r-- | shell/key-bindings.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 6035a978..174cd647 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -71,7 +71,7 @@ if command -v ruby > /dev/null; then h = {} i = 0 - File.read("/tmp/fzf-bash-history").scan(/^#([0-9]+)$\n(.*?)\n(?=^#[0-9]+$|\z)/m) do |t, c| + File.read("/tmp/fzf-bash-history").encode!("UTF-8", "UTF-8", :invalid => :replace).scan(/^#([0-9]+)$\n(.*?)\n(?=^#[0-9]+$|\z)/m) do |t, c| next if c.empty? h.delete(c) h[c] = [i += 1, t] |