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.

Filter by
Sorted by
Tagged with
1
vote
1answer
37 views

“i” key is not functional in bash

In bash, the key that normally outputs the i character, stays dead. It does not output anything, no space no character, multiple keystrokes of same key do neither. This is happening on trisquel8, out ...
1
vote
1answer
25 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 ...
3
votes
2answers
822 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
-1
votes
1answer
41 views

What does `bind '“\C-i”: menu-complete'` do?

I would like to fill out a command which expects a file argument, by alternating the files in the current directory. So I followed Gilles' reply Bind the Tab key to the menu-complete command ...
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 ...
2
votes
3answers
234 views

Alternative to Ctrl-R reverse search in bash

I am happy and really like the Ctrl-R backward search feature of the bash shell. Some of my colleagues don't like it, since it is sometimes confusing. I understand them. If you enter the wrong ...
23
votes
9answers
5k views

How to repeat currently typed in parameter on bash console?

I was just typing something along the lines of: mv foo/bar/poit/zoid/narf.txt and suddenly realized, damn, I have to type large parts of that parameter again mv foo/bar/poit/zoid/narf.txt foo/bar/...
0
votes
1answer
45 views

Bash not loading inputrc automatically

No matter what I try I can't get bash to load my ~/.inputrc file. The most minimal example I have tested is getting rid of my ~/.bashrc and then having a single line in my ~/.inputrc with set ...
1
vote
1answer
27 views

Readline: using tab as menu-complete, how do I “accept” the auto-completed directory and display the next level down?

I'm using the following settings on my readline (~/.inputrc): set show-all-if-ambiguous on set menu-complete-display-prefix on set completion-ignore-case on "\t": menu-complete "\e[Z": menu-complete-...
0
votes
1answer
139 views

Input from readline owerwrites the prompt

I'm trying to create an interactive bash script, where i can call given options from 1-n or just them like commands. It will end up with a simulated prompt and 'read' is used to get the input, ofc. ...
5
votes
1answer
491 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 ...
1
vote
0answers
21 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 ...
0
votes
0answers
20 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 ...
2
votes
1answer
631 views

Tab and complete

Is the key binding for tab to complete in the readline settings set implicitly. Because when I outputted bind -q complete I got this in return complete can be invoked via "\C-i", "\e\e". Thanks ...
0
votes
2answers
55 views

Text from standard input not visible after program exits from a readline

I am facing an issue where the text from my stdin is not visible from on my terminal. My program does the following Sets a SIGALRM handler which exits a program when there is no input from the user ...
1
vote
2answers
224 views

How can I permanently correct a typo in my last bash command?

It's not uncommon that I make a typo when entering commands in my bash interactive shell. I'd like to be able to correct the typo in my bash history so that the incorrect command does not pollute it ...
0
votes
0answers
31 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 ...
3
votes
1answer
63 views

Using multiple copy buffers in Bash

Ctrlu cuts text from current location to the beginning of line. Now, I can paste this with Ctrly whenever I want until the next time I hit Ctrlu to copy another line in the buffer. Now the problem I ...
6
votes
1answer
2k views

Using shell's read command with live editing functionality (readline like)

Is there a standard (POSIX) way of asking the user some data from within a shell script, with read for example, while allowing live edition of the text being typed (what readline does)? I know bash ...
5
votes
2answers
1k views

Is there a POSIX shell alternative to read -e? [duplicate]

How can I achieve the effects of read -e (which turns on line editing via readline and is available in bash) from a general (POSIX) shell? I don’t want to lose POSIX compatibility just because of this ...
0
votes
0answers
76 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 ...
6
votes
3answers
2k views

Deleting input forward to the next space

When in terminal I can use Ctrl+w to delete a whole word or IP (. is separator for each octet) when going leftward of prompt. However, if I try Alt+d to go rightward of prompt, terminal recognizes "." ...
0
votes
1answer
38 views

How to clear the screen from command line in GAP

Normally I can clear the screen with ctrl-L but while running GAP, ctr-l just displays the last command entered.
0
votes
0answers
48 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. ...
4
votes
1answer
1k views

Logging interactive input and output without capturing all typed input and control characters

I am trying to log output from an interactive command-line program; units, specifically. I have tried using tee like this: units | tee units.log or script like this: script -c units units.log ...
0
votes
0answers
14 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
1answer
928 views

How to get PHP 7.1 to use libreadline.so.8?

After an update of my Manjaro system, my PHP server stopped working, with the error "php: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or ...
1
vote
2answers
254 views

On backspace, `bash read -e` also deletes same-line printf (preexistent) text

I use printf "input: "; read -e. I type something then I press Backspace. When reaching the last character, this deletes the input: part together with it. Backspace doesn't misbehave if I hadn't typed ...
4
votes
3answers
2k views

Dealing with GNU Stow conflicts

What is the recommended way of dealing with GNU Stow conflicts? I tried to stow readline-6.2 and got the following warning: > stow readline-6.2 Loading defaults from /home/josh/.stowrc WARNING! ...
0
votes
2answers
164 views

How to make Readline in vi mode to read .vimrc?

When using Readline's vi mode in Bash, I can use command v from normal mode, to open the current command line in Vim for editing. However, in this case, Vim does not read my ~/.vimrc file, so none of ...
1
vote
2answers
111 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-...
-1
votes
2answers
65 views

What does “set keymap vi” actually do?

In an effort to vim-theme Readline, I see there are two set editing-mode vi set keymap vi I believe I understand what editing-mode vi does providing different VIM keymaps to edit, and insert text ...
4
votes
1answer
761 views

Make Bash's vi-mode default to “normal” Vi mode (not “insert”), and place cursor at start of line, mimicking KornShell

I'm trying to get Bash to mimic the behaviour of KornShell93 (ksh) when the shells are in Vi command line editing mode. KornShell defaults to "Vi normal mode" (a.k.a. "command" mode) and it also ...
2
votes
1answer
54 views

Generate brace expansion from list of files

This brace expression will generate a list of files: $ touch {foo{.t,t.t},other.txt,test{,.{ascii,t{est.qt,x{t,xt}}}}} $ ls foo.t foot.t other.txt test test.ascii test.test.qt test.txt test.txxt ...
0
votes
3answers
182 views

Shell - Print values in a comma separated string

I have a txt file with some comma separated values. cat file.txt abc,def,ghi abc,ghi def,abc,ghi def,abc abc,def abc,def,ghi I want to print these values with while do read line from file separated ...
0
votes
0answers
45 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
66 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 ...
3
votes
2answers
666 views

How do I convert inputrc settings to bashrc ones?

I'd like to keep my modifications to as few files as possible, so I don't want to touch .inputrc unless I absolutely have to. So, given .inputrc lines like: "\e[5~": history-search-backward "\e[6~": ...
0
votes
1answer
43 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 .. } ...
6
votes
1answer
154 views

Unexpected behaviour from Readline's bind command

I hadn’t yet researched whether or not bracketed paste mode is supported by the version of Bash/Readline on my Ubuntu 16.04 system (it isn’t) and out of curiosity, I ran the following command ...
0
votes
1answer
38 views

Tab auto-deletion at command line

Running Ubuntu 18.04 and using bash. So I am aware of how to use tabs at the command line to auto-complete the next token with file paths and what have you. Question: is there an easy shortcut for ...
0
votes
0answers
113 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 ...
2
votes
1answer
115 views

bash in-line brace expansion

Does bash/readline have a binding or a function that a key combination can be binded to in order to expand in-line braces? Similar to the way M-* key combination can be used for in-line globbing ...
1
vote
1answer
807 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 ...
0
votes
1answer
79 views

Rlwrap vi-movement-mode does not work with some programs

With rlwrap cat or rlwrap bash I can use keybinding "jk" to exit from insert mode. This does not work with rlwrap ghci. Why?
13
votes
3answers
7k views

~/.inputrc file not sourcing correctly

I have this ~/.inputrc file that I created for certain key bindings. # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving "\e[1;5C":forward-word "\e[1;5D":backward-word "\e[5C":forward-...
6
votes
3answers
2k views

Change $TERMINFO in bashrc script

I'm trying to set TERMINFO="$HOME/.terminfo" within my .bashrc script. The reason being is that my terminal isn't in the system terminfo location, and so I have its terminfo file in my home directory. ...
1
vote
1answer
44 views

What are bindable variables?

Reading Bash-4.4 Release Available, I noticed the following sentence. There is a new bindable variable, `colored-completion-prefix', which, if set, causes the common prefix of a set of ...
5
votes
2answers
576 views

Is there a way to define a bash readline command? [closed]

I can not find a way to do that from bash. So Is there a way to define a bash readline shortcut that will insert a dynamically generated string at the position of the cursor? E.g., I want to insert ...
0
votes
6answers
125 views

Replace counter field in large file with iterated value

I have a huge text file with about 70k lines in it. My objective is to read this file, match a pattern ("Count"), and add or replace its value with an iterated number. What I'm doing is : Reading ...