fish-shell/src
Johannes Altmanninger dcff0a2f2b Add Control+R incremental history search in pager
This reimplements ridiculousfish/control_r which is a more future-proof
approach than #6686.
Pressing Control+R shows history in our pager and allows to search filter
commands with the pager search field.

On the surface, this works just like in other shells; though there are
some differences.

- Our pager shows multiple results at a time.
- Other shells allow to use up arrow/down arrow to select adjacent entries
  in history. Shouldn't be hard to implement but the hidden state might
  confuse users and it doesn't play well with up-or-search, so this is
  left out.

Users might expect the history pager to use subsequence matching (fuzzy
matching) like the completion pager, however due to the history pager design it
uses substring matching.  We could change this in future, however that means
we would also want to change the ordering from "reverse-chronological" to
"longest common subsequence" (e.g. what fuzzy finders do), because otherwise
a query "fis" might give this ordering:

            fsck /dev/disk/by-partlabel/Linux\x20filesystem
            fish

which is probably not what the user wants.

The pager shows only a small number of history items at a time.  This is
because, as explained above, the history pager does not support subsequence
matching, so navigating it does not scale well.

Closes #602
2022-07-30 23:27:24 +02:00
..
builtins Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
widecharwidth Update widecharwidth 2022-02-14 22:19:28 +01:00
ast_node_types.inc
ast.cpp fix cppcheck missing return errors 2022-04-08 17:59:09 -07:00
ast.h Correct a misleading comment 2022-07-02 11:30:59 -07:00
autoload.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
autoload.h Reimplement autosuggestion-triggered completion loading 2022-06-19 15:15:17 -07:00
builtin.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
builtin.h Clarify that the variable/mode *name* is invalid 2022-04-08 16:38:46 +02:00
color.cpp Simplify ASSERT_SORT_ORDER 2021-07-15 13:15:24 -07:00
color.h Refactor color.h/color.cpp 2021-02-08 15:16:21 -06:00
common.cpp Clarify escaping of ASCII control characters 2022-07-27 11:24:35 +02:00
common.h Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
complete.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
complete.h Add Control+R incremental history search in pager 2022-07-30 23:27:24 +02:00
enum_map.h enum_map stuff to enum_map.h 2021-10-01 03:39:43 -07:00
enum_set.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
env_dispatch.cpp Use env_dispatch to update cursor selection mode 2022-07-30 09:49:07 -07:00
env_dispatch.h Try to rationalize universal variable syncing 2022-05-30 14:09:06 -07:00
env_universal_common.cpp Stop migrating legacy uvar paths 2022-03-17 18:15:11 +01:00
env_universal_common.h Stop migrating legacy uvar paths 2022-03-17 18:15:11 +01:00
env.cpp clang-format C++ files 2022-07-27 10:05:41 +02:00
env.h set --show: Show the originally inherited value, if any 2022-06-27 20:33:26 +02:00
event.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
event.h Stop removing unfired one-shot handlers 2022-06-06 12:18:29 -07:00
exec.cpp Replace a bunch of ASSERT_IS_MAIN_THREAD 2022-06-20 12:31:36 -07:00
exec.h exec.h: remove unused declaration 2021-09-24 09:30:25 -07:00
expand.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
expand.h Rationalize tilde unexpansion 2022-04-10 13:41:21 -07:00
fallback.cpp Remove wcsndup and wcslcpy 2022-03-17 18:15:11 +01:00
fallback.h Remove wcsndup and wcslcpy 2022-03-17 18:15:11 +01:00
fd_monitor.cpp Correct bug causing early teardown of fd_monitor 2022-03-31 20:41:58 -07:00
fd_monitor.h Correct bug causing early teardown of fd_monitor 2022-03-31 20:41:58 -07:00
fds.cpp Allow for EWOULDBLOCK instead of EAGAIN 2022-07-23 23:16:44 +02:00
fds.h Allow using poll() to check for readability 2022-01-02 16:36:33 -08:00
fish_indent.cpp Clean up woption 2022-04-02 11:28:30 -07:00
fish_key_reader.cpp Clean up woption 2022-04-02 11:28:30 -07:00
fish_test_helper.cpp Teach fish_test_helper to sigint_self 2022-05-28 16:08:17 -07:00
fish_tests.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
fish_version.cpp Fix build 2021-09-21 18:33:14 -07:00
fish_version.h
fish.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
flog.cpp Migrate remaining calls from debug_safe to FLOGF_SAFE 2021-07-05 15:47:56 -07:00
flog.h Migrate remaining calls from debug_safe to FLOGF_SAFE 2021-07-05 15:47:56 -07:00
function.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
function.h Reimplement autosuggestion-triggered completion loading 2022-06-19 15:15:17 -07:00
future_feature_flags.cpp clang-format C++ files 2022-06-01 10:02:09 -07:00
future_feature_flags.h Force stderr-nocaret feature flag on 2022-04-15 13:42:38 +02:00
global_safety.h Replace a bunch of ASSERT_IS_MAIN_THREAD 2022-06-20 12:31:36 -07:00
highlight.cpp Initialize variable 2022-05-11 21:28:26 +02:00
highlight.h clang-format C++ files 2022-06-01 10:02:09 -07:00
history_file.cpp Correct a cast when measuring history file size 2022-04-01 10:25:05 -07:00
history_file.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
history.cpp Switch path_get_data_is_remote to returning a real class enum 2021-12-18 20:48:13 -08:00
history.h Highlight history searches correctly (#9066) 2022-07-13 16:48:04 +02:00
input_common.cpp Replace a bunch of ASSERT_IS_MAIN_THREAD 2022-06-20 12:31:36 -07:00
input_common.h Add Control+R incremental history search in pager 2022-07-30 23:27:24 +02:00
input.cpp Add Control+R incremental history search in pager 2022-07-30 23:27:24 +02:00
input.h Use dedicated variable to configure selection size 2022-07-30 09:49:07 -07:00
intern.cpp
intern.h
io.cpp Allow for EWOULDBLOCK instead of EAGAIN 2022-07-23 23:16:44 +02:00
io.h clang-format C++ files 2022-06-01 10:02:09 -07:00
iothread.cpp Remove iothread drain flag 2022-06-19 15:15:20 -07:00
iothread.h Remove iothread drain flag 2022-06-19 15:15:20 -07:00
job_group.cpp Remove cancellation groups 2022-03-20 14:39:00 -07:00
job_group.h Remove cancellation groups 2022-03-20 14:39:00 -07:00
kill.cpp Make the kill ring thread-safe 2021-04-21 17:37:44 -07:00
kill.h Implementation of variable with killring entries 2021-04-21 16:39:29 -07:00
lru.h Reimplement autosuggestion-triggered completion loading 2022-06-19 15:15:17 -07:00
maybe.h maybe.h: reference header new 2021-08-17 18:57:16 -05:00
null_terminated_array.cpp Rework null terminated arrays 2021-03-28 15:31:25 -07:00
null_terminated_array.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
operation_context.cpp Allow specifying a limit on number of expansion in operation_context 2020-12-22 12:38:51 -08:00
operation_context.h Expand more when performing history path detection 2021-01-08 12:58:34 -08:00
output.cpp Fix tparm kludge 2022-03-14 15:36:17 +01:00
output.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
pager.cpp Add Control+R incremental history search in pager 2022-07-30 23:27:24 +02:00
pager.h Centralize how we invalidate pager rendering after completions change 2022-07-30 23:27:24 +02:00
parse_constants.h Highlight history searches correctly (#9066) 2022-07-13 16:48:04 +02:00
parse_execution.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
parse_execution.h parse_execution: remove unused 'job' parameters 2022-04-07 09:36:54 -07:00
parse_tree.cpp Rename EXEC_ERR_MSG to INVALID_PIPELINE_CMD_ERR_MSG 2022-03-31 15:49:15 -07:00
parse_tree.h Rename EXEC_ERR_MSG to INVALID_PIPELINE_CMD_ERR_MSG 2022-03-31 15:49:15 -07:00
parse_util.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
parse_util.h Fix regression expanding \$() 2022-04-03 15:54:08 +02:00
parser_keywords.cpp docs: list reserved keywords 2022-06-16 19:45:55 +10:00
parser_keywords.h Remove unused functions, members (and a variable) 2022-04-09 10:10:44 -07:00
parser.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
parser.h Stop initializing principal parser at global scope 2022-06-20 12:31:36 -07:00
path.cpp Remove sys/mount.h include 2022-07-24 12:24:42 +02:00
path.h Rationalize path-getting 2022-04-23 15:24:27 -07:00
postfork.cpp clang-format C++ files 2022-07-27 10:05:41 +02:00
postfork.h Refactor tty transfer to be more deliberate 2022-03-19 14:48:36 -07:00
print_help.cpp
print_help.h
proc.cpp Generate job & process exit events for background jobs 2022-07-30 10:06:33 -07:00
proc.h Check for waitstatus orientation via cmake 2022-07-24 16:40:33 +02:00
re.cpp Remove usage of PCRE2_SUBSTITUTE_LITERAL 2022-07-10 11:17:19 -07:00
re.h Remove usage of PCRE2_SUBSTITUTE_LITERAL 2022-07-10 11:17:19 -07:00
reader.cpp Add Control+R incremental history search in pager 2022-07-30 23:27:24 +02:00
reader.h Use env_dispatch to update cursor selection mode 2022-07-30 09:49:07 -07:00
redirection.cpp
redirection.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
screen.cpp trivial cleanup 2022-04-08 17:59:09 -07:00
screen.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
signal.cpp Allow trapping SIGINT and SIGTERM in scripts 2022-05-28 17:44:13 -07:00
signal.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
termsize.cpp Include <termios.h> instead of <sys/termios.h>. 2021-03-02 12:05:07 +01:00
termsize.h
timer.cpp clang-format C++ files 2022-06-01 10:02:09 -07:00
timer.h Pass some parameters by reference/move 2021-03-21 19:41:36 +01:00
tinyexpr.cpp Merge branch 'master' into te-refactor 2022-03-13 11:24:31 +01:00
tinyexpr.h math: Use wchar 2020-12-14 22:54:53 +01:00
tokenizer.cpp Remove the is_first parameter from tok_is_string_character 2022-04-16 10:47:01 -07:00
tokenizer.h Remove the is_first parameter from tok_is_string_character 2022-04-16 10:47:01 -07:00
topic_monitor.cpp Allow for EWOULDBLOCK instead of EAGAIN 2022-07-23 23:16:44 +02:00
topic_monitor.h Revert "Replace some simple loops with STL algorithms" 2022-04-09 12:12:16 -07:00
trace.cpp Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES 2022-07-27 11:24:35 +02:00
trace.h Cache if tracing is enabled 2021-10-28 19:39:30 +02:00
utf8.cpp
utf8.h
util.cpp wcsfilecmp: Stop actually computing the numbers 2021-10-07 17:57:52 +02:00
util.h
wait_handle.cpp Refactor wait handles 2021-05-17 15:25:21 -07:00
wait_handle.h Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
wcstringutil.cpp Remove unused functions, members (and a variable) 2022-04-09 10:10:44 -07:00
wcstringutil.h Remove unused functions, members (and a variable) 2022-04-09 10:10:44 -07:00
wgetopt.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
wgetopt.h Clean up woption 2022-04-02 11:28:30 -07:00
wildcard.cpp Clean up wildcard_has 2021-11-27 12:48:04 -08:00
wildcard.h Clean up wildcard_has 2021-11-27 12:48:04 -08:00
wutil.cpp Remove sys/mount.h include 2022-07-24 12:24:42 +02:00
wutil.h Just remove the dumb comment. 2022-07-17 14:41:35 -07:00