mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 19:41:15 -03:00
Implement history search --reverse (#4375)
* Implement `history search --reverse` It should be possible to have `history search` output ordered oldest to newest like nearly every other shell including bash, ksh, zsh, and csh. We can't make this the default because too many people expect the current behavior. This simply makes it possible for people to define their own abbreviations or functions that provide behavior they are likely used to if they are transitioning to fish from another shell. This also fixes a bug in the `history` function with respect to how it handles the `-n` / `--max` flag. Fixes #4354 * Fix comment for format_history_record()
This commit is contained in:
@@ -50,8 +50,8 @@ expect_prompt -re {start2\r\necho start1; builtin history; echo end1\r\nend2\r\n
|
||||
# ==========
|
||||
# Verify explicit searching for the first two commands in the previous tests
|
||||
# returns the expected results.
|
||||
send "history search echo start\r"
|
||||
expect_prompt -re {\r\necho start1.*\r\necho start2} {
|
||||
send "history search --reverse 'echo start'\r"
|
||||
expect_prompt -re {\r\necho start1;.*\r\necho start2;} {
|
||||
puts "history function explicit search succeeded"
|
||||
} timeout {
|
||||
puts stderr "history function explicit search failed"
|
||||
|
||||
Reference in New Issue
Block a user