Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [inputrc]

inputrc is the configuration file for Readline library

0
votes
1answer
22 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 ...
0
votes
0answers
14 views

bash COMPREPLY with custom colors

Is there a way to have a COMPREPLY return colored output? I can get it to work when readline recognizes the output as a folder when I have bind "set colored-stats on", but I can't make my own colors. ...
1
vote
2answers
51 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
88 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
56 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
252 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
69 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 ...
6
votes
1answer
1k 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
727 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
149 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
48 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
266 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://...
2
votes
1answer
619 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
714 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 ...
2
votes
2answers
1k 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
105 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 ...
3
votes
0answers
137 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
1k 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
439 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
247 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 ...
2
votes
1answer
507 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?
2
votes
1answer
163 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
270 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
979 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
544 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 ...
3
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 ...
6
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 ...
3
votes
1answer
134 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
2k 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
616 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
789 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 ...
15
votes
3answers
1k 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
365 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
0answers
479 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
696 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
74 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
406 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 ...
23
votes
1answer
2k views

Execute a readline function without keybinding?

I was just reading the readline man-page and disovered 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 ...
2
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": ...
4
votes
4answers
2k views

How to print keypresses in .inputrc format?

Which application can I use to figure out what to put in .inputrc for any custom keyboard shortcut? I've tried a few, and none of them seem to be usable: showkey, showkey -a and read just print ' if ...
5
votes
2answers
410 views

How to print keyboard shortcuts in human-readable form?

It would be very useful to have a user-friendly way to get an overview of the currently defined keyboard shortcuts. In other words, given the /etc/inputrc lines "\e[A": history-search-backward "\e[11~...
16
votes
2answers
3k views

Copy and set-mark in Bash as in Emacs?

I would like to be able to copy and paste text in the command line in Bash using the same keyboard bindings that Emacs uses by default (i.e. using C-space for set-mark, M-w to copy text, C-y, M-y to ...