Questions tagged [readline]

GNU Readline is a library that provides command-line editing and history searching capabilities for Bash and other interactive command-line programs. Use this tag for questions relating to the use of Readline functionality in Bash and other software.

37 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
493 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 ...
4
votes
0answers
288 views

Bash command not found due to stray garbage characters

What is the cause of this behavior? $ cd ../ $ bash: $'\210\210cd': command not found This happens sometimes (rarely) when I enter a command, there is no visible character preceding the cd, still it ...
3
votes
1answer
23 views

How to Set Readline key bindings in both vi-command and vi-insert modes

To use the Emacs transpose-words function in vi mode I have the following .inputrc: $if mode=vi bind Control-b: transpose-words $endif Unfortunately it only works in "insert" mode. What is the ...
3
votes
0answers
140 views

Moving cursor to end of line when using history-search-backward

I recently added the following lines to my .inputrc: "\e[A": history-search-backward "\e[B": history-search-forward However, I noticed when using this that my cursor does not jump to the end of the ...
3
votes
1answer
640 views

bash/gnu readline multiline command: move row up/down

How to move one editing row up (back) or down (forward) in a multi-line command in bash/readline? Somethnig like gj/gk in Vim.
3
votes
0answers
264 views

Are there any command line IRC clients that use readline?

I'm currently using irssi as my irc client, which is ok, mostly, but there are a couple of things that would make the chat experience better: readline support -- the ability to use vi key bindings in ...
2
votes
0answers
31 views

How to read readline key bindings

bind -P gives me back things like bracketed-paste-begin can be found on "\e[200~". revert-line can be found on "\e\C-r", "\er". previous-history can be found on "\C-p", "\eOA", "\e[A". How do I ...
2
votes
0answers
163 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 ...
2
votes
2answers
1k views

arrow keys are not working with terminal server telnet (termnetd) session

I am using terminal server package termnetd 3.2, which reads serial port and gives output on telnet port. I logged into terminal server port, every thing works fine except the arrow keys, Home and End ...
1
vote
0answers
23 views

In GNU readline, How to change Alt key to Meta, instead of being ESC?

In GNU readline manual, it says the left Alt is usually Meta: The Meta key is labeled ALT on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ...
1
vote
1answer
27 views

How do I use bind (or .inputrc) to map two bash commands to one key?

Normally, I use vi mode in bash. It starts off in insert mode you have to hit Esc (or Altj was it?) to get into normal (command) mode. I also bind ↑ (up-arrow) to history-search-backward. What ...
1
vote
0answers
24 views

how to detect state of bash readline using bash script?

for example; if [ 'readline is vi-command' ]; then echo 'normal mode' else echo 'insert mode' fi I really don't have any idea how to do this and I can't seem to find anything on the man pages ...
1
vote
0answers
43 views

How do I clear a suggestion from history-beginning-search-backward or history-beginning-search-forward?

How do I clear a suggestion when history-beginning-search-backward is invoked? For example: sudo vim #history-beginning-search-backward gets executed by a keybinding sudo vim /etc/hosts Once in ...
1
vote
0answers
92 views

How to configure 'readline' such that GNU/Octave's 'input' command can browse its history

In this script: #!/usr/bin/octave --line-editing a = input("command: ", "s"); a = input("command: ", "s"); during the second input, if you press the up arrow, it should show the command entered in ...
1
vote
1answer
858 views

serial port via minicom: can minicom use line-editing (i.e. readline functionality)?

I am successfully talking to a board connected over a serial port interface to my PC. I can both send and receive bytes - but for interactive applications executing on the board, that try to read ...
1
vote
0answers
113 views

readline - use of modifiers other than control and meta

I'm trying to use Apple's ⌘ command and ⌥ option keys to map some functions in readline to no avail. As per the man page I used octal values but that doesn't seem to work \xHH the eight-bit ...
1
vote
0answers
296 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 ...
1
vote
1answer
162 views

How can I change readline settings on keypress?

I checked docs for readline (in man bash), and I can't find a way to solve one problem: how to change readline setting (set ... on/off) on keypress? Keybindings seem to have form: key:function or ...
1
vote
0answers
171 views

Readline menu-complete on OS X

I'm trying to test out using the menu-complete on OS X 10.8, and it's just not working. I have it in my .inputrc as such: "\M-s": menu-complete I then tried to do C-x C-r to reload the .inputrc and ...
1
vote
1answer
215 views

Disable tab autocompletion in interactive mode

I have set disable-completion on in my ~/.inputrc, however this doesn't affect php in interactive mode (php -a). I would like to copy some code from another editor to the php interactive shell which ...
1
vote
0answers
172 views

Are there any editline configuration files available to make it act more like readline?

With editline replacing readline in a few software packages I use, the annoyance is growing at editline's behaviors and shortcomings. Is there someone maintaining a configuration file to at least make ...
0
votes
0answers
29 views

gcc: readline/libreadline.a: No such file or directory gcc: readline/libhistory.a: No such file or directory

I am trying to install python readline 6.2.4.1 package on SLES 11 SP3 but I am getting the following error: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -...
0
votes
0answers
28 views

Redo not working correctly for (readline) `vi` command-line editing

I'm using vi command-line editing: shopt -o -s vi My problem is that while undo (u) works as expected, that is not true redo (.). In particular, if I've the following command-line AA BB CC, then ...
0
votes
0answers
38 views

readline suddenly stopped working in Python app under FreeBSD 12

I have a Python3 CRUD app that I've been using on by BSD VPS that started giving me the following error yesterday. ImportError: /usr/local/lib/python3.6/lib-dynload/readline.so: Undefined symbol "...
0
votes
0answers
23 views

How to trigger tmux copy-mode using bash `bind` command

I'm trying to trigger tmux copy-mode using bash builtin bind command only in readline normal mode(vi-move) using this: bind -m vi-move -x '"vv": "tmux copy-mode"' its working but the problem is, it ...
0
votes
0answers
33 views

Mimic command on Linux

I find it really useful when using osx to have the Control key freed up to use emacs-like shortcuts in most applications, but in Linux it tends to be used for shortcuts instead. Is there a way to ...
0
votes
0answers
104 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
0answers
55 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. ...
0
votes
0answers
16 views

Ctrl-Y yanking in Node repl doesn't work

I like interactively working in a REPL, so I was a bit confused when firing up Node's node process and seeing that all the readline shortcuts I usually use worked as normal, except yanking with Ctrl-Y....
0
votes
0answers
46 views

How to bind a key in bash to a function that modifies the current command line

This is an extension to: https://stackoverflow.com/questions/4200800/in-bash-how-do-i-bind-a-function-key-to-a-command. I am looking for a way (through bash and/or readline) to bind a key to a ...
0
votes
1answer
75 views

readline keybindings in chrome/chromium

Does a chrome/chromium extension exist that can configure often used readline keybindings? Specifically Ctrl+a for Home, Ctrl+e for End, Ctrl+d, etc for use within a text editing box. I have found ...
0
votes
1answer
49 views

prompt (PS1) doesn't update on bound command

I don't understand why these two different ways to use the same command lead to different behaviors. I've installed fzf and fd and have the following lines in .bashrc function updir(){ cd .. } ...
0
votes
0answers
129 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
369 views

Readline: treat dash as a word break character

I'd like Readline to consider words separated by dashes as single words, just as Vim does by default. So for example, if I'm at the end of the line below and I type ctrl-W cp long-filename-with-...
0
votes
0answers
97 views

readline emacs equivalent to vi's 'fc'

In vi readline, I can use the command fc where c is a character I want to find and jump to in the current line. E.g. echo 'hello world' fw --------> Is there an equivalent command in emacs mode? ...
-2
votes
1answer
134 views

Script To Update Multiple Hostnames

Needing a script to read row by row, then ssh into the machine and update the hostname of the machine, then exit and continue with the next row. We have a cvs file that contains the previous hostname ...
-3
votes
2answers
205 views

inter process comunication in bash read commands in multiple background functions

I'm trying to get the following code to read from a main input then read that in one function then be able to send that into the input of another function but i am having trouble getting it to work ...