help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Bash history


From: Eduardo A . Bustamante López
Subject: Re: [Help-bash] Bash history
Date: Mon, 23 Mar 2015 13:17:04 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

The actual function that does the fetch from history is part of readline.
Readline is not bash, but, they're developed and distributed together.

That function is:

>From file: bash/lib/readline/misc.c
582 /* Get the previous item out of our interactive history, making it the 
current
583    line.  If there is no previous history, just ding. */
584 int
585 rl_get_previous_history (count, key)
586      int count, key;
587 {
588   HIST_ENTRY *old_temp, *temp;

The place where up arrow is bound to that rl_get_previous_history function is 
here:

>From file: bash/lib/readline/readline.c
1268   rl_bind_keyseq_if_unbound ("\033[A", rl_get_previous_history);
1269   rl_bind_keyseq_if_unbound ("\033[B", rl_get_next_history);
1270   rl_bind_keyseq_if_unbound ("\033[C", rl_forward_char);
1271   rl_bind_keyseq_if_unbound ("\033[D", rl_backward_char);

(function is: bind_arrow_keys_internal (Keymap map))

You can start reading there, to see what can be done. I'm not sure about the
Shift part though.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]