Questions tagged [inputrc]

inputrc is the configuration file for Readline library

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Complete list of options for .inputrc / readline

I always knew you could switch between Vim and Emacs bindings for Bash by modifying .inputrc. I'm now realizing there are actually a few different useful options I've decided to turn on including: ...
1
vote
1answer
39 views

Rebinding reverse-search-history in bash

reverse-search-history is bound to C-r by default. One can type C-r to start the search, and then type C-r again to jump to an earlier match. I have bound reverse-search-history to \er (Alt-r). This ...
1
vote
1answer
35 views

How to bind a key combination to null in .inputrc?

You can bind keys like Ctrl-Left and Ctrl-Right in .inputrc like this: # Ctrl-Left "\033[1;5D": backward-word # Ctrl-Right "\033[1;5C": forward-word How would I bind Ctrl-Up and Ctrl-Down to nothing?...
-1
votes
1answer
50 views

What Popular Programs Use GNU Readline?

I was reading about key-bindings in Bash. They seem to be based on Emacs but offer the ability to switch to vi based ones. You can do set -o vi in your .bashrc to effect Bash, but I saw there was ...
0
votes
1answer
42 views

Can I set one profile for every server I connect with SSH?

I need to create new VMs in the cloud very often for my job. Every time I connect a new remote server with ssh, I need to set some configs like completion-ignore-case on in my ~/.inputrc manually. ...
6
votes
2answers
95 views

Briefly jump to matching parentheses in Bash

In vim there is an option called showmatch. When you type a closing parenthesis in insert mode, this jumps the cursor to the matching opening parenthesis (at the same nesting level), then back again. ...
2
votes
2answers
99 views

Where is actually documented, that “\e” stands for the Alt key in .inputrc

A few days ago I learned, that I can use "\ej": history-search-backward "\ek": history-search-forward for avoiding the arrow keys. Now while that works like a charm and i began to read the bash-docs ...
1
vote
1answer
33 views

How do I tell readline to use an updated .inputrc?

I have updated my ~/.inputrc file to test out show-all-if-unmodified, and now want to try it out. How do I use it without logging off and back in?
1
vote
1answer
67 views

Non recursive .inputrc macros

I was looking to bind " to automatically insert a pair and put the cursor in the middle. Theoretically, like this: "\"": "\"\"\C-b" But this would act recursively causing this error message to pop ...
0
votes
0answers
270 views

`~/.inputrc` vi editing mode with emacs shortcut keys, `Control-e: end-of-line` not working

I am using Debian 9 with the Bash shell as default. This is my ~/.inputrc file. set editing-mode vi set show-mode-in-prompt on set vi-ins-mode-string "+ " set vi-cmd-mode-string "- " # in vi-command ...
0
votes
1answer
336 views

inputrc not working in ubuntu 18 as it used to in 16 and below

I used to create a simple .inputrc in my users directory and add the following: "e[A": history-search-backward "e[B": history-search-forward "e[C": forward-char "e[D": backward-char reload bash ...
1
vote
2answers
195 views

Why is my readline / .inputrc configuration being ignored?

I have a configuration line in my .inputrc: set enable-bracketed-paste on # Insert paste as a string rather than possibly running it This is valid when typed at the command line: bind 'set enable-...
2
votes
1answer
488 views

Bash's “set -o vi” vs readline's own options?

I know there is, for readline, set editing-mode vi You can put the above option in ~/.inputrc, editing-mode is documented by Readline as editing-mode (emacs) Controls whether readline begins with ...
0
votes
0answers
178 views

how to make `.inputrc` keybindings to work on commands that are using `read`?

I have this snippet in my .inputrc to map jj as enter/return. "jj": "\C-M" It works well but not for commands that are using read, for example entering passwords. How can I make this to also work ...
0
votes
1answer
575 views

Bash ignores vi-ins/cmd-mode-string options in .inputrc

When I first created my .inputrc (it didn't exist by default), I set vi-ins-mode-string to "+" and vi-cmd-mode-string to ":" to differentiate between modes. I didn't have "(cmd)" or "(ins)" prepended ...
0
votes
2answers
200 views

Use environment variable in .inputrc keybinding

I'd like to add a keybinding to my .inputrc that puts the value of an environment variable, USER, on the command line. I tried all kinds of escaping but the string $USER is written verbatim to the ...
13
votes
1answer
6k views

What's the difference between .bashrc and .inputrc

I am new to the unix system, and find it interesting to create customized functions and configurations in the setting files like .bashrc and .inputrc. However, I don't understand the differences ...
9
votes
1answer
913 views

.inputrc vs .bashrc settings

I've noticed few settings in .bashrc and .inputrc files look the same or are similar, such as: shopt -s nocaseglob vs set completion-ignore-case export HISTSIZE vs set history-size export ...
0
votes
2answers
251 views

Call functions from bashrc in inputrc

I'm on Arch Linux (4.13.11) and in my .bashrc, there's a custom function that finds a file using fzf and then opens that file with the default editor: # Search a file with fzf inside a Tmux pane and ...
-1
votes
1answer
75 views

Readline keymapping C-/ not working

I have the following line in my .inputrc which does not appear to be working: "\C-/": insert-comment When I press C-/ I expect the current line to be prefixed with the comment character (#) and ...
3
votes
0answers
375 views

Bash 4.4 change color vi mode

I am using +~ $ bash --version GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://...
4
votes
2answers
1k views

unbind default key from inputrc

What I want to do is made C-h not send backwards-delete-char there is nothing about it in my inputrc files but is shows up in bind -p
0
votes
1answer
1k views

Make zsh use readline instead of zle?

Is there a way to make zsh use readline reading /etc/inputrc and ~/.inputrc instead of zle module? I keep my command-line key bindings in inputrc to be applied globally to all other "shells" who use ...
3
votes
2answers
2k views

How to bind Ctrl+arrows/backspace/del to the Readline commands

I'm trying to make the following bindings in my ~/.inputrc: (Ctrl+Del): kill-word (Ctrl+Backspace): backward-kill-word (Ctrl+forward arrow): forward-word (Ctrl+back arrow): backward-word (Home): ...
0
votes
1answer
139 views

Bash/Readline vi line editing mode doesn't work in Screen

I have set -o vi in my ~/.profile, and it works fine on the regular console and under Tmux. But when I run Screen, if I press Escape or ^[, I get a visual bell, the next key I press seems to get eaten ...
2
votes
0answers
176 views

inputrc GNU readline vi-insert mode mappings do not seem to take effect

I have set vi-mode in my ~/.inputrc. The command-mode keybinds seem to work fine whereas the insert-mode keybindings do not have any effect at all. Specifically, the following are my insert mode ...
1
vote
1answer
2k views

Make ctrl-backspace different than ctrl-h [duplicate]

I am running Debian Jessie. I am using Xterm, though I would prefer an answer which works in a virtual terminal as well. Here, "backspace" is the key with the backwards arrow, two keys above the "...
3
votes
1answer
642 views

Readline bindings not working with Control and Shift modifiers

I'm tweaking with GNU Readline's key bindings in Bash. Specifically, I wish to achieve the following mapping effect: Control' ==> 'I' ControlShift' ==> "I" Control` ==> `I` Control[ ==>...
3
votes
2answers
347 views

If statement in inputrc

I'm using a central location for my bashrc and source that for all my users like this: GLOBAL_BASHRC="/path/to/global/bashrc" if [ -r "$GLOBAL_BASHRC" -a -f "$GLOBAL_BASHRC" ]; then # Load the ...
3
votes
1answer
925 views

How do I properly source .inputrc?

I have several set commands in .inputrc. Previously I've loaded them via source .inputrc, but some programs are unhappy with set commands in .profile. What is the correct way of sourcing it?
1
vote
1answer
190 views

Bash: mapping backward-delete-char to a different key

In bash, is it possible to map backward delete not to physical <Backspace> key but to some other key? I.e., <F18> has the following escape sequence [1;5Q, and I tried adding the following ...
1
vote
0answers
319 views

paste clipboard text plus string with .inputrc

I've got in my .inputrc something like "\C-v": "script.sh " I use a link from my clipboard as a parameter for the script, so I type ctrl-v and then paste the link, and then hit enter. So I've seen ...
3
votes
1answer
1k views

Bind Ctrl-\ in inputrc?

I've been futzing around with this and can't seem to get it to work. Using Ctrl+V in the terminal correctly outputs ^\ for this combination so it should be recognizable. As I have Ctrl+\ bound to ...
1
vote
1answer
1k views

inputrc not loading correctly

I added the following to my ~/.inputrc: set show-all-if-ambiguous on # single tab to start completion help set completion-ignore-case on # completion is case-insensitive $include /etc/inputrc If ...
4
votes
2answers
642 views

bash - ignore case but disallow autocomplete if ambiguous

Recently i face inconvenient when using bash auto complete with ignore case. Let's say i have this directories: [xiaobai@xiaobai test]$ l total 20K 3407873 drwx------. 60 xiaobai xiaobai 4.0K May 25 ...
5
votes
1answer
1k views

Bind C-i and TAB keys to different commands in terminal applications via .inputrc

For what I have tried, TAB and C-i in .inputrc seems to mean the same thing, whatever I bind to one is bound to the other. I know that originally, it was the same thing and that this behavior is kind ...
7
votes
2answers
1k views

Bash displays international characters as escape sequences

When I press certain keys (e.g. German umlauts) in the bash command line, I get escape sequences. For example, ß gives me \303. These escape sequences are treated as single characters, so one ...
2
votes
1answer
147 views

using shortcuts to move in bash command line [duplicate]

When I use Ctrl+Left_arrow or Ctrl+Right_arrow in bash, I move backward a "word" and forward a "word" respectively. I belive, this is defined in /etc/inputrc # mappings for Ctrl-left-arrow and Ctrl-...
7
votes
1answer
3k views

tmux option `xterm-keys` does not enable control+arrows

I cannot make tmux recognize Ctrl-Left-arrow sequence differently from just a left arrow, and the same for the right arrow too. In my ~/.inputrc, I have mapped these sequences (as issued by 2 ...
6
votes
2answers
794 views

Recover last argument of the last command in bash' vi mode

When using bash's vi mode (set -o vi), is it possible to recover the last argument of the last executed command? This is done in emacs mode with ESC+., and I would like to do it in vi mode as well. I ...
3
votes
2answers
1k views

bash - wrong key sequence bindings with control+alt+space

I am trying to install some key sequence bindings but I have trouble. My shell is bash, my terminal is gnome-terminal, and my system is Ubuntu 14.04 in graphic mode. Edit : my keyboard is french ...
16
votes
3answers
2k views

How to call a “sub” .inputrc? (Like in .bashrc, where you can “source sub_script.sh”)

My ~/.bashrc contains exactly one line: source my_config/my_actual_bashrc.sh Is there an equivalent with .inputrc, so my customizations can be in a separate location, and "called" by ~/.inputrc?
1
vote
1answer
450 views

Why is “bind ~/.inputrc” causing my up-right slash key ('/') to be disabled until I re-login?

Below is my .inputrc file. Why, after calling bind ~/.inputrc, is my up-right slash key disabled, until I logout and login again? # Key-bindings for the command-line editor. # Ask before displaying &...
5
votes
1answer
512 views

Assign both menu-complete and dynamic-complete-history to TAB

Is there a way for me to assign both menu-complete and dynamic-complete-history to Tab (or one to Tab and the other to Tab-Tab) in .inputrc? I'm thinking there might be a way to setup a function and ...
3
votes
2answers
858 views

bash completion in Posix mode

I would like to use an interactive Posix bash shell but the autocomplete feature doesn't work. When I type the Tab character it simply prints a tab. The tab completion works only when I'm in a non-...
3
votes
1answer
97 views

Why did my “d” break when I screwed up a bind?

I was swapping some readline settings in my .bashrc earlier today and mistyped the following (bind since it's not in .inputrc): bind "mark-symlinked-directories on" I forgot to put a set in there ...
1
vote
1answer
436 views

Modify .inputrc to fix Mac Terminal bug with vi mode

I currently have a bug in my Mac's Terminal (I actually use iTerm2 but it's still there), where once I press left arrow after typing, I can't go past the last character. Is there a way I can modify ...
13
votes
1answer
12k views

Delete whole argument in current bash command-line

Using ^W (unix-word-rubout) I can easily delete a single "word" from the current command in my bash shell. However, when dealing with quoted arguments that contain spaces (or unquoted arguments ...
27
votes
1answer
2k views

Execute a readline function without keybinding?

I was just reading the readline man-page and discovered a bunch of great commands I didn't know about. However, several don't have default key bindings. Is there a way to execute the unbound commands ...
3
votes
1answer
1k views

readline: unix-word-rubout, but backwards, is it possible?

I'm trying to set up my .inputrc to perform a backwards unix-word-rubout but I'm currently failing at doing so. I have M-w mapped in my .inputrc. this does not work: "\eu": universal-argument "\ew": ...