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

learn more… | top users | synonyms

1
vote
2answers
38 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
0answers
22 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: ...
2
votes
1answer
62 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 ...
0
votes
1answer
20 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 ...
0
votes
0answers
58 views

debian squeeze how to install packages lib32readline5-dev and lib32ncurses5-dev

I am unable to install the packages lib32readline5-dev and lib32ncurses5-dev on debian squeeze. When I issue the command # apt-get install lib32readline5-dev lib32ncurses5-dev I get the error E: ...
0
votes
0answers
20 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 ...
1
vote
1answer
143 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 ...
2
votes
1answer
382 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 ...
0
votes
2answers
49 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 ...
0
votes
1answer
132 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 ...
3
votes
3answers
159 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
1answer
74 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 ...
2
votes
1answer
104 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 ...
1
vote
1answer
466 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 ...
2
votes
1answer
168 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 ...
0
votes
0answers
142 views

Cursor keys leave insert mode in irb in vi mode

I am using vi-mode in a ruby IRB by having a ~/.inputrc containing only the following line: set editing-mode vi Since I changed from ruby 1.8.7-p371 to ruby 1.9.3 and 2.0.0, IRB (and the rails ...
1
vote
0answers
174 views

.inputrc, TAB and CTRL-i

Apparently, when we hit TAB in Terminal, CTRL+i is send instead, so we cannot have different bindings for these keypresses in our .inputrc: "\C-i": forward-char TAB: complete This makes TAB move ...
4
votes
1answer
428 views

readline / bash: How to map Escape key and Arrow keys?

From another piece of command-line driven software, I'm used to the following behavior: Arrow up / down go through the command history, matching lines that match the characters typed so far on the ...
0
votes
2answers
488 views

How can I iterate through possible completions in gnu readline?

In a shell that implements GNU Readline, I can click the key to get a list of possible completions to what I started typing. For example: C:\>cd P<TAB> PerfLogs\ Program Files ...
1
vote
1answer
213 views

readline reverse-search-history C-r repeatedly finds next cmd, how to go back to previous?

This is probably a very simple question, but I would really like to find out if this is possible. If I start a reverse history search with C-r and then press C-r again multiple times I can search for ...
3
votes
2answers
757 views

Bash readline deleting till the previous slash

In bash emacs mode, is there anyway to delete till the previous slash character? For example if i entered the command cp /usr/local/bin/reallylongincorrectfolder ...
2
votes
1answer
145 views

Bash readline move cursor to previous forward slash

In bash , we can move back or forward by 1 word or character. Is there any option where i can move the cursor to the previous character that i specify, for example Forward Slash. ? Something like the ...
4
votes
1answer
617 views

Strange keyboard when using sqlite shell on linux

I use a linux box connected trough putty. Using it with bash, my keyboard performs well, but when I am using the sqlite shell (sqlite3 program) my keys get crazy: del=^[[3~ up=^[[A left=^[[D ...
2
votes
1answer
200 views

How to disable the key 'V' in VI Editing Mode against bash

As we know, after changed the Readline mode to vi by command set -o vi and set editing-mod vi, press the key v can into an temp file to edit command (here more details). I want to disable that ...
2
votes
1answer
375 views

bash/readline for “move forward by whitespace-delimited word?”

In bash/readline, if you want to navigate through a command, often you have things like: cat /home/foo/bar.txt /home/bar/baz.txt If my cursor is at the end of the line (^e), and I want to move back ...
4
votes
1answer
307 views

Way to move cursor by arguments in bash?

In bash, you can use M-f and M-b to move the cursor one word forward and backwards, but is there a way to move one argument forward or backwards? If not out of the box, perhaps by some configuration? ...
1
vote
1answer
219 views

Switching between readline editing-modes in GNU octave

When punching away at the keyboard on the octave command line, I sometimes find that the various readline shortcuts stop working, e.g. C-a and C-e just insert ^A and ^E. It took me a while to realize ...
13
votes
1answer
621 views

Why do `bind` and `.inputrc` behave differently?

I'm trying to do the right thing and put my key bindings into ~/.inputrc. However, it turns out that I have to change bind '"\e\C-j":"\e[1~quiet \e[4~\n"' into "\e\C-j": "\eOHquiet \eOF\n" Now ...
0
votes
1answer
400 views

Bash default command line editing mode

What is the default command line editing mode for bash? I have been playing around with the command line editing modes in bash.The problem is that i have added lines in bashrc to toggle the vi and ...
1
vote
1answer
962 views

How to bind up arrow in ~/.inputrc (readline) for vim insert mode?

When in Readline apps with vim mode enabled in ~/.inputrc (set editing-mode vi) is there a way to bind the <Up> arrow key in vi-insert mode? To display previous history item, for example. It ...
6
votes
2answers
421 views

Is it possible to control the whole Gnome desktop with vi-like commands?

I know with readline you can use emacs or vi commands to edit the input of several interactive text programs. I wonder if there exists such a similar facility to control the whole desktop in Gnome or ...
1
vote
0answers
43 views

Making M-u, M-l, and M-c apply to whole words in readline

This is what I've come up with so far: "\C-\eU": upcase-word "\C-\eL": downcase-word "\C-\eC": capitalize-word "\eu": "\C-f\eb\C-\eU" "\el": "\C-f\eb\C-\eL" "\ec": "\C-f\eb\C-\eC" Is there some ...
3
votes
2answers
694 views

How to override default bash key-bindings?

I write this config file: # ~/.inputrc Control-d: "\C-udate +'%F %T'\C-m" I want to run date command when I type Ctrl-d. But I cannot override the default behavior(exit). Thanks for your help.
21
votes
1answer
3k views

How do I reload .inputrc using a bash script?

This question explains how to reload .inputrc using C-x C-r. But how would one reload it using commands in a bash script?
6
votes
2answers
2k views

How can I enable readline for PHP 5.4 on Ubuntu 11.10?

I installed PHP 5.4 on my Ubuntu 11.10 PC like this: $ sudo add-apt-repository ppa:ondrej/php5 $ sudo apt-get update $ sudo apt-get install php5 It's working fine but I don't have the readline ...
1
vote
2answers
2k views

Can't install GNU readline on CentOS 5 (Amazon EC2)

I'm attempting to install GNU readline on a CentOS 5 so that I can use it with some Python 2.7 modules, specifically the Cmd module. I've installed Python2.7 as a standalone library per these ...
8
votes
1answer
285 views

Is there a way of using ctrl-r after typing part of command in bash?

In bash the Ctrl+r command is very useful, I type Ctrl+r whatever and it searchs my history for commands containing the word whatever. But if I type whatever and realize that I would like search that ...
1
vote
1answer
406 views

Bind CTRL+W to werase (default bash behaviour in Linux/PuTTY) in iTerm2

I use a Mac at home and have changed my modifier keys swapping Command and CTRL, so CTRL+T spawns a new tab in chrome, CTRL+C is copy and so forth. I use Windows/Linux at work and I want a consistent ...
8
votes
2answers
487 views

Readline in vi mode: how can I enable up/down arrows?

When bash has vi bindings available (set -o vi), up/down arrows work in both command and insertion mode. When I setup readline's ~/.inputrc to use vi mode (set editing-mode vi), applications like ...
7
votes
1answer
316 views

Why you don't read lines with “for” in bash?

I've read that using "for" is not a good way to read lines in bash. Many people says this is clumsy and inefficient at best, and fails in many cases. I'd like to know what is the best way to read ...
0
votes
1answer
339 views

When an ssh session is forcibly disconnected, readline breaks (mac)

On Mac's iTerm app, when I ssh into remote machines and the connection is terminated by either power loss or connection failure, some of the time, readline in the terminal fails. At least, I think ...
1
vote
1answer
214 views

changing bash hotkeys

I would like to change some hotkeys in bash to match the dos prompt, because I go back and forth between them. I see that in order to change some of the hotkeys in bash, I need to change the ...
2
votes
1answer
112 views

Readline in vi mode: how can I access previously executed commands?

I recently followed this post's advice on how to make vi more ubiquitous and I changed my readline mode to vi. Before I did this, I could use the arrow keys to access previously executed commands. ...
10
votes
4answers
1k views

Is there any way to save a keyboard macro in bash?

I would like to permanently save a keyboard macro that I've recorded using C-x ( and C-x ). Is there an easy way to "see the source" for my newly recorded macro so that I can bind it to a keyboard ...
5
votes
1answer
817 views

readline: difference between vi, vi-move, vi-command, vi-insert keymaps

The readline(3) manpage lists these four (vi, vi-move, vi-command, vi-insert) as possible options for the keymap setting. I have tried setting these different options and they seem to have no effect ...
1
vote
1answer
617 views

Using readline keyboard shortcuts in OSX korn shell

I am using ksh on Mac OS X 10.6 xterm (that is, not using Terminal.app). When I try to browse the command history via CTRL+P or try to move the cursor on my prompt via CTRL+B, only the characters ^P ...
31
votes
2answers
10k views

How do I reload .inputrc?

Background I have heard that the readline module is reading ~/.inputrc and that is how it changes the behaviour of keystrokes under programs such as bash. Question How can I reload this after ...
1
vote
1answer
268 views

libreadline history lines combine

This has been driving me crazy for about three years. I don't know how to fully describe the problem, but I think I can finally describe a way to recreate it. Your milage may vary. I have a mixture ...
0
votes
1answer
2k views

Why doesn't iPython see readline?

I am trying to compare/contrast various python tools and I would like ipython in the mix, but when I run ipython I get the readline warning even though readline is installed on my mac: WARNING: ...
2
votes
1answer
835 views

Bash readline blink-matching-paren not blinking matching parentheses

Bash readline has a setting called blink-matching-paren that is not working for me. If I type an open parenthesis on the command line, then some text, then a close parenthesis I don't get any ...