In ~/.inputrc I have:
Code: Select all
"\e[A": history-search-backward
"\e[B": history-search-forward
In LM17 It works, except after the first or last command it trashes whatever you've typed and replaces it with a [
Is there a fix for this?
Code: Select all
"\e[A": history-search-backward
"\e[B": history-search-forward
Code: Select all
user@skynet1 ~ $ grep apt-get .bash_history
sudo apt-get install grml-rescueboot --dry-run
sudo apt-get install pastebinit
man apt-get
user@skynet1 ~ $
in ~/.bashrc works for me, and has for years.iatest=$(expr index "$-" i)
if [[ $iatest > 0 ]]; then bind '"\e[A": history-search-backward'; fi
if [[ $iatest > 0 ]]; then bind '"\e[B": history-search-forward'; fi
I'm on 17.3. I do not have a ~/.inputrc. I do have a /etc/inputrc. I can move up and down the history file by using the up and down arrow keys.Minterator wrote:The most useful feature in Terminal. Pressing Up/Down recalls previous/next command or the most recent command that matches a partial command line.
In ~/.inputrc I have:
In LM13 it works as expected, it simply stops after it recalls the first or last command.Code: Select all
"\e[A": history-search-backward "\e[B": history-search-forward
In LM17 It works, except after the first or last command it trashes whatever you've typed and replaces it with a [
Is there a fix for this?
bind -p|grep history
and check the key mapping for next-history and previous-history.Thank you. I wasn't logging off because changes in ~/.inputrc take effect every time you open a new Terminal.lmuserx4849 wrote:I'm on 17.3. I do not have a ~/.inputrc. I do have a /etc/inputrc. I can move up and down the history file by using the up and down arrow keys.Minterator wrote:The most useful feature in Terminal. Pressing Up/Down recalls previous/next command or the most recent command that matches a partial command line.
In ~/.inputrc I have:
In LM13 it works as expected, it simply stops after it recalls the first or last command.Code: Select all
"\e[A": history-search-backward "\e[B": history-search-forward
In LM17 It works, except after the first or last command it trashes whatever you've typed and replaces it with a [
Is there a fix for this?
Maybe to narrow it down, first rename the local version, logoff/on and try bash history. There is a command to load (bind -f ~/.inputrc), but be sure and logoff/on. Also checkbind -p|grep history
and check the key mapping for next-history and previous-history.
Bash Reference - Sample inputrc
Code: Select all
##### Filename Completion #####
##set completion-ignore-case on # ignore case on completion. -- Doesn't work here, in ~/.bashrc: bind 'set completion-ignore-case on'
##set mark-directories on # append slash to dirs. -- Doesn't work here, in ~/.bashrc: bind 'set mark-directories on'
set visible-stats on # ls -F completion
##"\C-i": menu-complete # Tab cycles through filenames instead of listing.
TAB: menu-complete
"\e[Z": menu-complete-backward # Reverse with Shift+Tab
set show-all-if-ambiguous on # list possible completions instead of ringing bell
set show-all-if-unmodified on
set mark-symlinked-directories on
#set match-hidden-files off # same as typing * before Tab
set bell-style none # no bell on tab-completion
set skip-completed-text on
I'm going to say yes and no. I've only known Linux Mint since 17, so I can't say how it worked before that version.You're saying that local ~/.inputrc may not be needed in 17.3? Does your up/down complete a partial line from history?
I also have Tab/Shift+Tab cycling through filenames, is that default on you system?
Code: Select all
===> bind -p|grep previous-history
"\C-p": previous-history
"\eOA": previous-history
"\e[A": previous-history
In the bash reference, "menu-complete" is shown with no meta keys (menu-complete ()). I didn't see it in the output of bind -p either. I tried it and it wasn't until I added the two lines below in ./inputrc that I was able to cycle through files instead of just getting a list.complete (TAB)
Attempt to perform completion on the text before point. The actual completion performed is application-specific. Bash attempts completion treating the text as a variable (if the text begins with ‘$’), username (if the text begins with ‘~’), hostname (if the text begins with ‘@’), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted.
Code: Select all
"\t": menu-complete
"\e[Z": menu-complete-backward
Code: Select all
ESCAPE: kill-whole-line # Escape clears line
# Delete from cursor to beginning/end of line
##"\e[1;5H": backward-kill-line # Ctrl+Home -- Doesn't work
##"\e[1;5F": kill-line # Ctrl+End -- Doesn't work
"\e[1;6D": backward-kill-line # Ctrl+Shift+Left
"\e[1;6C": kill-line # Ctrl+Shift+Right
"\e[1;2D": backward-kill-word # Shift+Left
"\e[1;2C": kill-word # Shift+Right
Code: Select all
# ~/.bashrc
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
export HISTSIZE=10000
export HISTFILESIZE=10000
bind 'set completion-ignore-case on' # ignore case on completion
bind 'set mark-directories on' # append slash to dirs
# Save and reload the history after each command finishes
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
export EDITOR=pluma
That sounds like a plan. I'd rename the ./.inputrc and add back as needed, one at a time.Minterator wrote:...
Like you said, the problem may be due to newer system files, like /etc/inputrc, conflicting with mine. I'm gonna try fix it and post again.
PS: It looks like somebody moved this thread to the wrong forum. This topic is about an Application, Terminal and its options, and has nothing to do with bash scripting.
Code: Select all
shopt -s histappend # history file appended rather than overwritten on exit
shopt -s histverify # history cmds reloaded for edit, verses immediatedly parsed
shopt -s histreedit # failed history substitutions are reloaded for edit
PROMPT_COMMAND="history -a; history -n; $PROMPT_COMMAND"