Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/reline/ansi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class Reline::ANSI
'khome' => :ed_move_to_beg,
'kend' => :ed_move_to_end,
'kdch1' => :key_delete,
'kpp' => :ed_search_prev_history,
'knp' => :ed_search_next_history,
'kcuu1' => :ed_prev_history,
'kcud1' => :ed_next_history,
'kcuf1' => :ed_next_char,
Expand Down
14 changes: 14 additions & 0 deletions test/reline/test_ansi_with_terminfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ def test_kdch1
omit e.message
end

# PgUp key
def test_kpp
assert_key_binding(Reline::Terminfo.tigetstr('kpp'), :ed_search_prev_history)
rescue Reline::Terminfo::TerminfoError => e
omit e.message
end

# PgDn key
def test_knp
assert_key_binding(Reline::Terminfo.tigetstr('knp'), :ed_search_next_history)
rescue Reline::Terminfo::TerminfoError => e
omit e.message
end

# Up arrow key
def test_kcuu1
assert_key_binding(Reline::Terminfo.tigetstr('kcuu1'), :ed_prev_history)
Expand Down