Skip to content

Conversation

@jameslazo
Copy link

Rebind redraw-current-line readline command from "\er" (ALT-R)

The custom key bind in /shell/key-bindings.bash overrides the default readline keybinding of "\er": revert-line, causing undocumented changes in readline command keybindings.

Solution: Bind redraw-current-line to "\eR" (SHIFT-ALT-R)

Attempting to manually rebind "\er" to revert-line in ~/.inputrc introduces unexpected behavior in the ALT_C operation of fzf, resulting in an empty complete readline command after the builtin cd, filling the terminal screen with all possible binary executables in the user's $PATH. This keybinding in the __fzf_cd__ function is used only internally and is not explicitly documented or exposed to fzf users. Using "\eR" rather than "\er" eliminates an unnecessary and undocumented default readline keybinding override that may confound users troubleshooting readline command keybindings.

Closes: #4634

Tests

make test

--- PASS: TestTrimLength (0.00s)
=== RUN   TestCharsLines
[[97 98 99 100 101 102 10]] true
[[97 98 99 100 101 102 10] [44032 45208 45796 10]] true
[[97 98 99 100 101 102 10] [44032 45208 45796 10] [9 100 101 102]] false
[[97 98] [99 100] [101 102 10] [44032]] true
[[97 98] [99 100] [101 102 10] [44032] [45208]] true
[[97 98] [99 100] [101 102 10] [44032] [45208] [45796 10]] true
[[97 98] [99 100] [101 102 10] [44032] [45208] [45796 10] [9]] true
[[97 98] [99 100] [101 102 10] [44032] [45208] [45796 10] [9] [100 101]] true
[[97 98] [99 100] [101 102 10] [44032] [45208] [45796 10] [9] [100 101] [102]] false
[[97 98] [99 100] [101 102 10] [44032] [45208] [45796 10] [9 100] [101 102]] false
[[97 98 99] [100 101] [102 10] [44032] [45208] [45796 10] [9 100 101] [102]] false
[[97 98 99] [100] [101] [102 10] [44032] [45208] [45796] [10] [9 100 101] [102]] false
[[97 98 99] [100] [101] [102] [10] [44032] [45208] [45796] [10] [9] [100] [101] [102]] false
--- PASS: TestCharsLines (0.00s)
=== RUN   TestEventBox
--- PASS: TestEventBox (0.00s)
=== RUN   TestMax
--- PASS: TestMax (0.00s)
=== RUN   TestMax16
--- PASS: TestMax16 (0.00s)
=== RUN   TestMax32
--- PASS: TestMax32 (0.00s)
=== RUN   TestMin
--- PASS: TestMin (0.00s)
=== RUN   TestMin32
--- PASS: TestMin32 (0.00s)
=== RUN   TestConstrain
--- PASS: TestConstrain (0.00s)
=== RUN   TestConstrain32
--- PASS: TestConstrain32 (0.00s)
=== RUN   TestAsUint16
--- PASS: TestAsUint16 (0.00s)
=== RUN   TestDurWithIn
--- PASS: TestDurWithIn (0.00s)
=== RUN   TestOnce
--- PASS: TestOnce (0.00s)
=== RUN   TestRunesWidth
--- PASS: TestRunesWidth (0.00s)
=== RUN   TestTruncate
--- PASS: TestTruncate (0.00s)
=== RUN   TestRepeatToFill
--- PASS: TestRepeatToFill (0.00s)
=== RUN   TestStringWidth
--- PASS: TestStringWidth (0.00s)
=== RUN   TestCompareVersions
--- PASS: TestCompareVersions (0.00s)
PASS
ok      github.com/junegunn/fzf/src/util        (cached)

make itest (verbose detail of skipped test)

  1) Skipped:
TestLayout#test_combinations [test/test_layout.rb:1228]:
Skipped, no message given

352 runs, 3334 assertions, 0 failures, 0 errors, 1 skips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undocumented override of readline default ALT-R ("\er") keybinding to revert-line in __fzf_cd__ function

1 participant