Skip to main content

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
0 votes
1 answer
70 views

I have just pasted a line into the bash shell. It contains embedded newlines. CTRL+a gets me to https at the start. CTRL+e gets me to 7d87 at the end. How can I move around from line 1 to 2 to 3 ...
Dan Jacobson's user avatar
0 votes
1 answer
50 views

$ bind -V | grep horiz print-completions-horizontally is set to `off' How do I set it to `on' from the bash command line? I know how to set it in ~/.inputrc. That's not my question.
Dan Jacobson's user avatar
2 votes
1 answer
87 views

I have a script read.sh: read -ei "hello world" eval $REPLY Upon executing chmod +x read.sh and then running ./read.sh, I notice that pressing Esc followed by b or w jumps between the ...
luna's user avatar
  • 25
1 vote
0 answers
62 views

I'm trying to use "read -e" to implement a user prompt with custom commands. For this I must disable the default command+filename completion. I tried this: complete -W 'cmd1 cmd2 cmd3' -D ...
Rihad's user avatar
  • 21
0 votes
1 answer
78 views

I was looking at this answer, and it lists a "keysym": \e[11~ to define pressing F1. What are keysyms and where can I get a list of them as \e[11~ doesn't seem to correlate with anything I'm ...
leeand00's user avatar
  • 4,971
1 vote
2 answers
119 views

stty -a shows cchars: stop = ^S, reprint = ^R. Ctrl-r is shadowed by readline's reverse-search-history, so when I press it I get the readline function Ctrl-s is not shadowed by readline's forward-...
user615536's user avatar
1 vote
1 answer
100 views

I sourced the /usr/share/doc/fzf/examples/key-bindings.bash file so fzf works in Bash; but how do you get that to work with the rlwrap ed approach?
mbigras's user avatar
  • 3,512
1 vote
2 answers
295 views

In bash, when binding TAB with menu-complete, I can cycle through the current files in the lexicographical or alphabetic order. What if the file that I want is the last file in the order? How can I ...
Tim's user avatar
  • 107k
1 vote
1 answer
93 views

On my macOS and Linux systems, I run ed with alias ed='rlwrap ed'. On macOS with rlwrap 0.46.1 (2022) I can freely create files with tabs like: $ ed a foo<TAB>bar but on my Linux systems with ...
mbigras's user avatar
  • 3,512
0 votes
1 answer
91 views

I'm trying to create readline macros and bindings, but struggling to find codes for some key sequences. How to find codes for key combinations, like "\e[1;2A" for Shift-Up, etc? By the way, ...
Alex's user avatar
  • 1
0 votes
1 answer
90 views

I am using Arch, bash and gnome terminal. All are up to date with the very latest software versions. I wish to bind ctrl+c to yank the current line on the command line to the global clipboard, which ...
Kes's user avatar
  • 909
1 vote
2 answers
135 views

I am having trouble with gdb. When I start pushing the Up Arrow key, it iterates backwards through the history. However, if I start typing a command, like b, instead of iterating only through history ...
havakok's user avatar
  • 249
4 votes
0 answers
151 views

Suppose I have filenames as follows on my Linux system: $ ls -1 file-index-00012.txt file-index-00345.txt question.txt I start typing, where "|" represents the cursor: $ cat fil| If I ...
Huw Walters's user avatar
-1 votes
1 answer
130 views

The TTY terminal driver uses a line discipline to provide features like: line buffering of input, echoing of input to the terminal display, control character translation, etc. The bash shell uses the ...
Tomek Dobrzynski's user avatar
1 vote
1 answer
98 views

As inputrc only has "if", "else" and "endif" and does not have an "else if" conditional statment, are nested conditionals permitted, viz a second "if" ...
J G Miller's user avatar
0 votes
1 answer
178 views

I'm using bind -x in vi-command mode to remap a keyboard character to a direct bash command, which in my case alters the current line (cd ..). Is there a way to at the same time map with -x AND ...
glades's user avatar
  • 126
1 vote
0 answers
56 views

The title says it all. I have set -o vi set for readline, but whenever I hit enter and execute a command, the new line will start in insert mode and I'll have to manually exit. Is there are an option ...
glades's user avatar
  • 126
0 votes
2 answers
109 views

I just discovered vi mode in bash that I enable with set -o vi in my .bashrc. Now I was quite excited to remap the "normal mode" equivalents to some handy functionality. First and foremost I ...
glades's user avatar
  • 126
8 votes
1 answer
1k views

This is a plaintext file, apparently limited to 300 lines. I use tee frequently on my system. $ file .tee_history .tee_history: Unicode text, UTF-8 text $ wc -l .tee_history 300 .tee_history $ tee --...
user598527's user avatar
1 vote
0 answers
49 views

I use Colemak + Bash Vi mode, and have remapped h j k l to h n e i in .inputrc. The original N n keys for repeating search seem to be bound to the same command: $ # Run in command mode $ bind -p | ...
UM-Li's user avatar
  • 47
1 vote
0 answers
931 views

I turn off enable-bracketed-paste feature whenever I log in into my bash, and I need to access a remote server which had not turned it off system wide. Many time, this is what I'm getting before I've ...
xpt's user avatar
  • 1,924
1 vote
0 answers
103 views

I devised a contraption to visualize the killring in Bash. It work like this: $ killring Killring: 1 Line one in killring 2 Line two in killring 3 Line three in killring However, there are some ...
Sebastian Carlos's user avatar
0 votes
0 answers
88 views

I have bracketed-paste-mode turned on in bash. I think it is a good safety feature and I would like to keep it. One problem I have is that it is difficult to differentiate a running command from one ...
Dan Robertson's user avatar
1 vote
1 answer
576 views

In the default mode of gdb, pressing ctrl+x a turns on and off the UI, and ctrl+x 2 cycles through different split views. There are a number of similar useful shortcuts. I can turn on vi emulation ...
Fraser's user avatar
  • 111
2 votes
0 answers
985 views

i have a fresh install of linux mint 21.1 as well as the latest version of xampp which comes with php 8.2.4. i added export PATH=$PATH:/opt/lampp/bin to .bashrc to access php from the terminal. it ...
bungee1980's user avatar
3 votes
1 answer
244 views

Is there a way to view your entire kill-ring besides repededly hitting M-y Somthing like emacs browse-kill-ring but for the shell
Nifle's user avatar
  • 569
0 votes
1 answer
526 views

I just learned that command lines have marks, just like emacs. But, unlike emacs, C-w doesn't delete the region, it only deletes one word backwards. Is there a readline equivalent for this?
ychaouche's user avatar
  • 1,043
6 votes
1 answer
530 views

Readline and therefore Bash have a very useful command called operate-and-get-next, bound by default to Ctrl-O, that executes the current line, after selecting it from the history, and advances the ...
Tobia's user avatar
  • 769
1 vote
1 answer
642 views

I have a PS1 set up in my .zshrc which includes multiple ANSI escape sequences. An equivalent definition works nicely in Bash, but in Zsh (v5.8.1) it seemingly causes the shell to calculate the width ...
Konrad Rudolph's user avatar
1 vote
2 answers
435 views

I am using the following control sequence to set up that when I click in the command line in shell (BASH) in XTerm the cursor moves to the position. At least, it used to worked that way in my ancient ...
mjf's user avatar
  • 113
1 vote
0 answers
485 views

Using Bash tput cup 0 0; read -e -p "Enter input: " userinput works well for getting a line of user input: It does not clear screen below the prompt It allows user to use arrow keys to go ...
codepoet's user avatar
  • 636
0 votes
1 answer
129 views

GNU readline considers consecutive alphanums as word, and all others are non-words, like -option1 -option2 has 4 words (" -", "option1", " -", "option2") which ...
Thomson's user avatar
  • 113
1 vote
1 answer
42 views

I use VI mode when using bash and I sometimes find that some of the standard compspec definitions don't do what I want. For example, java doesn't appear to know that you have been able to do java ...
Mark W's user avatar
  • 145
2 votes
1 answer
104 views

Is there any way to have ^W behave the same way as ^D with empty input in a shell? I use zsh, but this should apply to bash as well. It otherwise does nothing (if the input line is already cleared) ...
radu242's user avatar
  • 21
0 votes
0 answers
750 views

How do we execute/simulate key press from within bash line code script? e.g. alt-L a shortcut preset with a readline code is needed to be triggered in such bash line code How to achieve it?
user avatar
0 votes
1 answer
78 views

how to have repeated command in bash code/script to represent the typing Alt n as the number of repetition followed by a key and then hit Enter? e.g. have line code/script for (typing Alt 7) f (Enter)
user avatar
0 votes
0 answers
499 views

I was on my way with installing Linux from Scratch, when I was told to compile and install readline-8.1.2, in chapter 8.11, in LFS 11.1 systemd edition. I then went and got some old versions of ...
Aarav Gupta's user avatar
2 votes
1 answer
216 views

I am running GNU ed 1.18 on Fedora Linux 36. I run ed with rlwrap also installed which gives me access to my command history. My .ed_history file appears to have a size limit of 300 lines. I would ...
edman's user avatar
  • 598
2 votes
1 answer
367 views

Recently I ran across a few articles with tips on how to more efficiently use bash that mentioned a combination I'd never tried: Ctrl-S (in the prompt, with no command running) to search the other way ...
Nathan Tuggy's user avatar
1 vote
0 answers
670 views

I'm using INPUTRC to move the .inputrc file away from my home folder. It used to work (like with my GNU bash, version 5.1.4), but in bash version 5.1.16, I found that the INPUTRC is no longer honored. ...
xpt's user avatar
  • 1,924
12 votes
4 answers
4k views

Let me explain with an example: I have a line where I declare an alias in my ~/.bashrc: > grep lsdir ~/.bashrc alias lsdir='ls -d */' I have just added this line to my bashrc, and the alias is ...
adamency's user avatar
  • 423
25 votes
5 answers
7k views

I'm typing that command and my cursor is at the end of "supprimer des warnings" $ git commit -m "Nettoyage : > - Suppression de sources ou projets inutiles > - Corrections ...
Marc Le Bihan's user avatar
3 votes
1 answer
534 views

I have successfully bind the Enter key using: function foo() { echo 'Im a foo' } bind -m vi-insert -x '"\C-M": foo' the problem is I have no way of accepting the READLINE_LINE. How can ...
cevhyruz's user avatar
  • 477
13 votes
1 answer
3k views

I recently posted a question about a strange behavior I had observed in the bash, fish and zsh shells that was not exhibited by the tcsh, csh, ksh, or dash shells. It turns out the behavior was caused ...
terdon's user avatar
  • 253k
14 votes
1 answer
2k views

A couple of months ago, a system update caused my shell to no longer interpret trailing newlines as an enter when pasting a command into the terminal. For example, if I write ls at my prompt and then ...
terdon's user avatar
  • 253k
3 votes
1 answer
2k views

Starting with libreadline version 8.1, the default is to give special treatment to "bracketed paste" operations. This breaks parsing for my program, so I want to disable it. I know that it ...
Ethan's user avatar
  • 194
1 vote
1 answer
465 views

On Ubuntu, I have set alias sh='rlwrap --complete-filenames sh' to get readline keybindings and filename completion when using the dash shell (on my computer, sh is /usr/bin/sh, which is a symbolic ...
Flux's user avatar
  • 3,318
3 votes
0 answers
352 views

Using OSX I am able to use readline-specific bindings, such as going to the beginning of the line with CTRL+A, everywhere. I recently switched to Linux (specifically NixOS) and I've been missing this ...
Christian's user avatar
2 votes
1 answer
1k views

I have colored-completion-prefix set on in my ~/.inputrc file, but when I tab complete, the prefix part which has already been typed is a colour that I do not like. In the bash manual it says: "...
paradroid's user avatar
  • 1,275
2 votes
1 answer
775 views

My os info: uname -a Linux debian 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux Locale setting: locale LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" ...
showkey's user avatar
  • 601

1
2 3 4 5
7