Questions tagged [readline]
The Gnu readline library is used by other programs, such as shells and interpreters, to provide common line-editing capabilities.
95
questions
0
votes
0
answers
12
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 ...
0
votes
0
answers
61
views
inputrc not loaded on startup
When I load bash, my inputrc is not loaded unless I press C-x C-r to reload the inputrc file.
This is my inputrc:
## /etc/inputrc - global inputrc for libreadline
## See readline(3readline) and `info ...
0
votes
1
answer
87
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 ...
0
votes
0
answers
64
views
Disable history files in readline (Linux)
Is there a way to globally disable history files for programs using readline, but still having history per session?
If I set history-size to zero in .inputrc then it completely disables the history, ...
1
vote
1
answer
148
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 -...
0
votes
1
answer
35
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 ...
0
votes
1
answer
121
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 ...
1
vote
2
answers
300
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 ...
1
vote
0
answers
408
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 ...
1
vote
2
answers
656
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, ...
3
votes
1
answer
1k
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 ...
3
votes
3
answers
952
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.
...
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 ...
0
votes
1
answer
257
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 ...
2
votes
2
answers
383
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 ...
7
votes
1
answer
431
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 ...
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....
9
votes
4
answers
15k
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....
2
votes
0
answers
665
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 ...
2
votes
1
answer
3k
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 ...
0
votes
2
answers
598
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 ...
0
votes
2
answers
257
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 ...
2
votes
0
answers
272
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 ...
0
votes
1
answer
62
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 ...
1
vote
0
answers
137
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 ...
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....
10
votes
3
answers
5k
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 ....
1
vote
1
answer
1k
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 ...
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 ...
2
votes
1
answer
263
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.
4
votes
1
answer
802
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 ...
1
vote
2
answers
484
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 ...
1
vote
1
answer
246
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 ...
2
votes
2
answers
392
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 ...
1
vote
1
answer
388
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 ...
2
votes
0
answers
475
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 ...
0
votes
1
answer
252
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. ...
3
votes
2
answers
621
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 ...
0
votes
0
answers
99
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?...
8
votes
2
answers
1k
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 ...
1
vote
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 ...
2
votes
0
answers
309
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 ...
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 ...
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 ...
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 ...
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 ...
15
votes
4
answers
3k
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 ...
0
votes
3
answers
415
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 "...
4
votes
1
answer
975
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 ...
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/...