Questions tagged [readline]

The Gnu readline library is used by other programs, such as shells and interpreters, to provide common line-editing capabilities.

Filter by
Sorted by
Tagged with
0 votes
1 answer
44 views

Bash readline command of scrolling terminal lines up/down

What is the Bash readline command, ie. the phrasal words command, of scrolling terminal lines up/down with shift - Page up/down How to have all complete Bash readline commands (that are used by ...
itil nonok's user avatar
0 votes
0 answers
23 views

Modify inputrc/set readline to allow down arrow to remove unfinished command from history

On default Fedora and Debian and probably other distro installations one can type into bash and cycle previous history using up arrow and get back to the unfinished command using down arrow. Pressing ...
Yetoo's user avatar
  • 13
0 votes
1 answer
189 views

In Bash, how can I read the value of readline variable named `history-size`?

My Bash version I have updated from v590 to version 5.2.15(1)-release (i686-pc-linux-gnu). I use Kubuntu 20.04 and KNOPPIX 9.1. The readline variable history-size can be set to on or off, can be bind ...
Anton Wessel's user avatar
1 vote
1 answer
208 views

How to bind TabCompleteNext/TabCompletePrevious in PowerShell?

I tried the following commands to bind Ctrl-N and Ctrl-P in PowerShell 7.2.4, but they have no effect - new bindings do not work. Remove-PSReadLineKeyHandler Tab Remove-PSReadLineKeyHandler Tab -...
Konstantin Glukhov's user avatar
0 votes
1 answer
42 views

Control sequence for upper case letter

I'm trying to improve my touch-typing which is very low both on accuracy and speed. I've noticed that I have a great difficulty regarding upper case letters. I often have to leave the home row or I ...
jacksonbenete's user avatar
0 votes
1 answer
223 views

Copy relative links to absolute links

Given a directory /path/to/files that contains many relative links along the lines of foo -> ../other/data/foo, how do I copy the links in files/ to be absolute path links on /mydata/path/ I ...
lbutlr's user avatar
  • 113
1 vote
2 answers
367 views

Delete argument from command

If I have a commandline like this: sunday.exe monday tuesday-wednesday I would like to delete to the last space, or essentially the last argument. I tried Ctrl + Backspace, but it deletes only to the ...
Zombo's user avatar
  • 1
2 votes
0 answers
535 views

Make readline edit input command in external editor (similar behavior as "edit-and-execute-command" from bash)

Background So far I've found readline very useful since just by modifying a single configuration file (i.e. ~/.inputrc), you are configuring all those programs that depends on readline. The programs ...
gfe's user avatar
  • 177
1 vote
2 answers
763 views

Cannot backspace across wrapped lines in terminal

Suppose your terminal window is 80 columns wide and you run a python script containing only: print("x" * 81 + "\b\by") You would expect the output to be a line full of x except for the last one, ...
carloa21p's user avatar
3 votes
1 answer
2k views

vim-tmux-navigator to use tmux prefix instead of C-[hjkl]

I have installed vim-tmux-navigator on the tmux and the vim side and I can navigate between vim panes and tmux windows using Ctrl-[hjkl] BUT: This means that readline (or bash?) shortcuts are ...
Richard Wonka's user avatar
3 votes
3 answers
1k views

How to make Ctrl+D detach tmux, while retaining GNU readline capabilities in Bash?

Based upon my days and days of researching this, I may be seeking the impossible. Situation I have my .bashrc nicely configured to either spawn a new tmux on connect, or if one exists, attach to it. ...
anastrophe's user avatar
4 votes
1 answer
2k views

Move vi mode string to end of bash prompt

I use vi editing mode in bash. I have "show-mode-in-prompt" set to "on" in ~/.inputrc. show-mode-in-prompt (Off) If set to On, add a string to the beginning of the prompt indicating the ...
Josh Cooley's user avatar
0 votes
1 answer
323 views

Spacebar doesnt work in python shell or pdb

Was hoping someone here may have experienced this too. I often use ipython for a local python shell and everything works fine. But sometime I like to use pdb and the default python shell. I'm using ...
John Corrales's user avatar
2 votes
2 answers
473 views

Difference between "backward kill line" and "unix line discard"

I'm reading the bash man page and memorizing the keyboard shortcuts. C-x rubout is bound to backward kill line, and C-u is bound to unix line discard, but the descriptions for these commands look the ...
Wian Zeeman's user avatar
7 votes
1 answer
481 views

Mouse support for GNU Readline

Is it possible to get programs using GNU Readline (e.g. Bash, the Python REPL, or anything else that responds to ~/.inputrc) to let you edit the current line using the mouse? For example, I’d like to ...
Daniel H's user avatar
  • 1,624
2 votes
1 answer
1k views

Readline for Python 3.6 on Mac 10.14

I have Python 3.6.5 on Mac 10.14. In the Python interpreter, editing/navigation shortcuts (such as arrows, ^e, ^a, etc.) do not work, instead giving me escape chars, e.g.: Python 3.6....
Vlad K.'s user avatar
  • 121
9 votes
4 answers
17k views

Trouble with readline library on mac

I was updating some programs on my mac and I suddenly encountered some troubles running gnuplot. The error was something like : dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7....
kipgon's user avatar
  • 191
2 votes
0 answers
700 views

Node.js serialport readline parser - response devided to each sign in new line

I would need some help in resolving a node.js problem with serialport response on one computer with Ubuntu 18.04 64-bit. On the beginning I can confirm that the hardware which I have connected answers ...
Piotr Szatkowski's user avatar
2 votes
1 answer
4k views

Prevent Python from quitting on ctrl-D

I find the following often happens to me: I am using Python in an interactive terminal session I accidentally type something with unbalanced parentheses Python gives me a ... prompt, expecting me to ...
N. Virgo's user avatar
  • 325
0 votes
2 answers
613 views

Bash vi mode: simulating Enter in binding

I have a function fh() in my .bashrc. I want to bind Ctrl-F in vi-insert-mode to run this function. I have tried bind '"\C-F":"fh\n"' This types fh into my terminal and tries to autocomplete the ...
hollaboi's user avatar
0 votes
2 answers
277 views

Cut region out of bash input

Say that you have entered the following command into your terminal emulator: sudo apt-get apple pie install hamster You run it and realise your brain fart. You placed the package names apple and pie ...
Rovanion's user avatar
  • 245
2 votes
0 answers
302 views

Bash: history-search-backwards broken after ssh

I regularly ssh from my laptop (mac) to my desktop (linux), and sometimes, afterwards, the history-search-backwards ends up broken and just acts like previous-history. (I have not tracked whether it ...
AFoglia's user avatar
  • 121
0 votes
1 answer
67 views

Changing terminal buffer scrolling shortcut

As far as I know, the keyboard shortcut for scrolling terminal buffer is Shift+PgUp/PgDown, and it seems to be an universal standard, which makes me suspect it's not part of the terminal emulator, but ...
Jan Warchoł's user avatar
1 vote
0 answers
147 views

can bash be configured such that ctrl-W deletes words correctly?

Readline offers us two different functions to delete a word, neither appears to be configurable, and neither does the right thing. Is there some voodoo I can perform which will combine the behaviors ...
psp's user avatar
  • 111
16 votes
5 answers
7k views

Mac readline - Library not loaded

I'm working on a Mac, Sierra 10.12.3, and I'm trying to access a PostgreSQL database via the psql command, but it threw the error dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6....
skwidbreth's user avatar
11 votes
3 answers
6k views

How do I determine what version of readline bash is using?

How do I determine what version of readline I am using in my bash session? I am wondering specifically because I appear to have the readline library 6.3, but the set enable-bracketed-paste on in my ....
asmeurer's user avatar
  • 570
1 vote
1 answer
2k views

line wrapping breaks intermittently (R, tmux, readline)

I often keep several R command-line interactive sessions running on my desktop at work, linked to vim with the vim-r-plugin (which is kind of like ESS). I use tmux to connect to them remotely, and ...
Patrick B.'s user avatar
4 votes
1 answer
2k views

Tab completion for command arguments fail in Cygwin due to `.exe` extension

Is there a configuration option in Cygwin so that when Bash completes the name of the command, the filename’s .exe suffix is ignored (not included)? Explanation of the problem When using tab ...
Anthony Geoghegan's user avatar
2 votes
1 answer
272 views

What is a close option in zsh to readline's `completion-prefix-display-length`

When completing, if the typed part is long, this option replaces the same part in the completion menu items with ellipsis. Especially useful if the typed part is long and there are many candidates.
xuhdev's user avatar
  • 1,781
4 votes
1 answer
873 views

zsh read input in zle widget

I am trying to implement a custom version of zsh history search when pressing ctrl-r (although my function will map to different shortcut). So far I have tried to use read , vared and read-command to ...
Hemant Kumar's user avatar
1 vote
2 answers
509 views

Changing the "Meta" key for the readline library

I'm interested in rebinding the meta key for the readline library (command line editing in, say, bash) from the alt key to some other arbitrary key (like the caps lock key). For context, I'm already ...
wafflecat's user avatar
  • 125
1 vote
1 answer
265 views

bash/readline doesn't autocomplete directory name

I have an executable in a subdirectory of the current directory: ~ $ ls -l src/users -rwxr-xr-x 1 me users 1001K Nov 17 18:52 src/users* I try to execute it by typing sr and then clicking tab. There ...
Martin Kunev's user avatar
2 votes
2 answers
440 views

Unbound keys in ReadLine

About using Readline with Bash: $ cat ~/.inputrc "\C-[[Z": complete-command "\C-[[23~": history-search-backward "\C-[[24~": history-search-forward Now in Gnome terminal F11 and F12 key search ...
porton's user avatar
  • 311
1 vote
1 answer
410 views

How do I get vi-style line editing in Vim command mode?

When typing a command with ":" in Vim, I often find myself hitting escape and/or trying to navigate with h,j,k and l or trying other vi-style key combinations to edit the command I am writing. I have ...
Daan's user avatar
  • 113
2 votes
0 answers
535 views

Enabling readline?

I have an .inputrc file set up on a system that doesn't seem to be respecting it. If I bind the file (as per this post) or try to load it with C-x C-r, nothing happens - I still do not get any of the ...
keflavich's user avatar
  • 413
0 votes
1 answer
265 views

How to change readline scroll behaviour on OS X?

I'm SSHing in Mac OS X Terminal to two ubuntu servers, then I connect to various readline-enabled shells, like MySQL or Mongo clients. Recently, it seems that somehow the scroll behaviour changed. ...
Aadaam's user avatar
  • 121
3 votes
2 answers
649 views

Completion when pasting Bash command beginning with tabs

I'm writing a Dockerfile which I'm formatting using tabs (which I usually use everywhere). But I've copied a multi-line command where the second line begins with two tab characters, i.e.: apt-get -y ...
lucasvc's user avatar
  • 212
0 votes
0 answers
113 views

Readline stops working randomly

For some reason every 1-3 hours (depending on work load) my shell read command stops accepting input and hitting return renders the ^M character. Something like: Continue? After answering: Continue?...
SystematicFrank's user avatar
9 votes
2 answers
2k views

Bind a key to newline in Bash, without submitting command

I want to press M-j and have readline place my cursor on the next line without entering a command. Thus I should be able to go back a character onto the prev. line. This answer states that it cannot ...
cdosborn's user avatar
  • 662
2 votes
1 answer
1k views

readline - deleting word under cursor

E.g. Alt-d deletes word until next word boundary. There's also a shortcut to delete until previous word boundary IIRC, but I'd like to delete word UNDER cursor (i.e. to current word left boundary and ...
LetMeSOThat4U's user avatar
2 votes
0 answers
343 views

Bash variable READLINE_LINE always empty

I was looking for a way to share clipboard between bash and X, but the variable $READLINE_LINE and $READLINE_POINT is always empty. Does anyone know the reason? Bash version is 4.3.30. See the post ...
godblessfq's user avatar
6 votes
1 answer
1k views

Setting Vim key bindings for the MySQL client

I add these following lines to ~/.inputrc and now the Postgres client, psql, uses Vim keybindings. set keymap vi set editing-mode vi However, this does not work for MySQL. I understand that MySQL no ...
jordelver's user avatar
  • 2,271
4 votes
1 answer
4k views

How to change BASH "editing-mode vi" shortcuts?

I'm trying to change my bash vi mode keys to enter and exit insert mode, I would like to set these shortcuts: Ctrl-\ : Enter moviment mode Alt-\ : Enter insert mode how can I do that? I'm trying ...
MaikoID's user avatar
  • 284
4 votes
1 answer
1k views

how to disable `alt-numkey` in bash shell

I can bounce between apps in Chrome OS by pressing alt-N, where N is the position of my app on the status bar. Useful! But when I'm in the bash shell of my Nitrous.io box, pressing alt-N to bounce to ...
Cody Hess's user avatar
  • 157
1 vote
1 answer
1k views

Meta keybindings for bash readline from .inputrc not working

If I put "\M-p": previous-history into my .inputrc and fire up a terminal (urxvt or xterm), hitting Alt-p prints a ":" character. Subsequent hits produce ^[p like so: :^[p^[p^[p^[p^[p I would like ...
Matt's user avatar
  • 165
15 votes
4 answers
4k views

I'm using Bash in "vi mode". What's the hotkey sequence to edit the current command line using an external editor?

In Bash's "Emacs mode" (set -o emacs), I can edit the current command line in my favorite external $EDITOR. All I have to do is press Ctrl+X then Ctrl+E. But, because I have switched to Bash's "vi ...
Alby's user avatar
  • 487
0 votes
3 answers
424 views

What does "vi-move" keymap in Bash's vi mode actually do?

The keymap section in the Bash Reference Manual says that one of the acceptable options is "vi-move". There doesn't seem to be any description for what this corresponds to. I'm well acquainted with "...
Pak's user avatar
  • 439
4 votes
1 answer
1k views

Use a separate history for 'read -e' (readline)

I would like to write an interactive command shell in shell script, for easier adjusting of the iptables firewall. The problem is, that read -e uses the shell history. Is there a way of using a ...
BenjiWiebe's user avatar
  • 9,015
4 votes
1 answer
3k views

Keystrokes and commands for my inputrc — key-combination for “Shift-Space”, remap “Ctrl-PageUp/PageDown” to something without Page-keys

I need to add some things to my inputrc. I'm using bash 4, as OS I'm using debian and OSX. My terminal emulators are rxvt-unicode-256 on debian and Terminal.app on OSX. My new macbook has no Insert/...
fooness's user avatar
  • 51
4 votes
1 answer
1k views

Common keyboard shortcuts for zsh zle and bash readline

I use zsh as my shell, but there are a lot of commandline programs which use readline. I also like to configure different keyboard shortcuts (e.g. ctrl backspace and ctrl delete). Is there a way to ...
simonzack's user avatar
  • 321