GNU Readline is a library for command line edition, used by bash and some other programs

learn more… | top users | synonyms

1
vote
1answer
33 views

bash/gnu readline multiline command: move row up/down

How to move one editing row up (back) or down (forward) in a multi-line command in bash/readline? Somethnig like gj/gk in Vim.
0
votes
1answer
42 views

inputrc not loading correctly

I added the following to my ~/.inputrc: set show-all-if-ambiguous on # single tab to start completion help set completion-ignore-case on # completion is case-insensitive $include /etc/inputrc ...
3
votes
0answers
72 views

Bash command not found due to stray garbage characters

What is the cause of this behavior? $ cd ../ $ bash: $'\210\210cd': command not found This happens sometimes (rarely) when I enter a command, there is no visible character preceding the cd, still ...
1
vote
0answers
55 views

Clear the terminal in “vi” mode? (equivalent of “ctrl+l” from “emacs” mode) [duplicate]

I am aware of Ctrl+L on bash terminal (using it on Ubuntu) which clears the screen by applying appropriate scrolling on bash terminal. After learning that the terminal is by default set to emacs mode ...
1
vote
1answer
36 views

How can I change readline settings on keypress?

I checked docs for readline (in man bash), and I can't find a way to solve one problem: how to change readline setting (set ... on/off) on keypress? Keybindings seem to have form: key:function or ...
1
vote
1answer
37 views

bash show-all-if-ambiguous turns on spontaneously

I am using tmux and bash. I find that, at seemingly random intervals, my running shells have show-all-if-ambiguous set to on. This is a significant annoyance to me, since many of my operations are in ...
1
vote
0answers
35 views

Are there any command line IRC clients that use readline?

I'm currently using irssi as my irc client, which is ok, mostly, but there are a couple of things that would make the chat experience better: readline support -- the ability to use vi key bindings ...
5
votes
2answers
219 views

Bash displays international characters as escape sequences

When I press certain keys (e.g. German umlauts) in the bash command line, I get escape sequences. For example, ß gives me \303. These escape sequences are treated as single characters, so one ...
5
votes
3answers
111 views

How to undo changes in the commands-history?

In UNIX systems you can press top and bottom arrows to navigate through the previous commands. This is extremely handy. Sometimes, I go up and find a command that I want to use again, but with some ...
4
votes
2answers
71 views

Coming back to a command I have partially written [duplicate]

Often I find myself partway through writing a long command (or chain of commands) and realise I need to run another command before I can finish typing out this current one. Examples Sometimes, I... ...
1
vote
1answer
79 views

Enable cursor keys in python shell over ssh

I run OpenElec on a Pi. I can ssh to the Pi and open a python shell. How do I enable the cursor keys to work like up getting to last command in the python shell, like it does on my Ubuntu box. Now ...
2
votes
2answers
96 views

How do I swap the two last command line arguments?

$ ln -s ./dir/target.txt /path/to/source.txt{cursor here} How do swap file typed filenames in command line? Alt+T swaps words, not filenames, resulting in ln -s ./dir/target.txt /path/to/txt.source. ...
1
vote
1answer
207 views

Strip newline from piped input

I've been setting up a script to work with haste-server. This takes piped or file input (tail /var/log/messages | haste and haste < /path/to/file.txt) and submits it to the server which then ...
5
votes
1answer
110 views

Remap Return key in terminal to prevent accidental command on productions servers

I am looking for a way to remap the key for executing commands in terminal (I am using bash) to prevent accidental commands on productions servers. Return should be disabled. I tried the following ...
4
votes
2answers
96 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 "." ...
5
votes
2answers
35 views

Is it possible to (re)define what readline (embedded in bash) defines as a word?

Many of the special Readline constructs allow the user to edit the command line in various ways. For instance, certain keystrokes allow moving forward a word. A word is defined to be what bash itself ...
2
votes
1answer
108 views

readline - why does does it only do carriage return and not a line feed when reaching end of line?

I developped a python application that uses the cmd module to make an interactive command-line interface. This cmd module uses readline for command-line management: completion, history... My issue ...
2
votes
0answers
119 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 ...
3
votes
1answer
412 views

What are the bash shell length limitations for here-docs?

What are the length limitations for using here-docs as part of bash command lines? I am finding that short here-docs work fine, but when they get longer there is some point or structure after which ...
0
votes
2answers
168 views

Is one bash shellshock fix tar file for SLES bad?

SERVER:/home/user # rpm -Uvh --test readline-5.1-24.4.7406.0.PTF.898762.i586.rpm warning: readline-5.1-24.4.7406.0.PTF.898762.i586.rpm: V3 DSA signature: NOKEY, key ID b37b98a9 error: Failed ...
1
vote
1answer
139 views

Custom tab-completion in bash's `read`

Is there a way to "import" a list of words into bash's read builtin to have custom tab-completion? I've been writing a wrapper script for suckless' minimalist irc client "ii", and I don't have a way ...
3
votes
1answer
145 views

Control-p freezes SSH session

I have encountered a strange situation on one of my SSH ARM machines I use on a daily basis. Every time I connect to the server and press Ctrl+P to invoke previous-history BASH function SSH connection ...
0
votes
2answers
343 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 ...
3
votes
3answers
179 views

confusing behavior of emacs-style keybindings in bash

Bash offers many useful emacs-style keybindings for simple commandline editing. For example, Ctrl+w deletes ("kills") word left from the cursor. Another keybinding, Alt+d is supposed to be a "mirror" ...
1
vote
1answer
60 views

How to provide a customized function 'complete' to readline of socat

Is this possible to provide a customized 'complete' function to the readline library that goes inside socat? I mean something quicker than recompiling the readline, some hook or text file ...
6
votes
1answer
203 views

Highlighting text in bash when using reverse history search using Ctrl-R

Using Ctrl-R, I can search the history in bash. But what to do, If I want to highlight the relevant word which has been typed upon by me. Example: (reverse-i-search)`mount': sudo mount /dev/sda2 ...
2
votes
1answer
391 views

bash not reading $TERMINFO on login (over SSH)

I have a OpenVZ Fedora 20 VPS that when I SSH into, my termcap file stored in $XDG_DATA_HOME/terminfo/x/xterm-termite, isn't being read, despite having TERMINFO=$XDG_DATA_HOME/terminfo set. If I ...
1
vote
1answer
82 views

How to turn on all default binding keys of vi-editing-mode on bash?

I am using vi-editing-mode on Bash. According to man readline, there are a couple of default binding keys working on vi-editing-mode. Some keys work well, but some other default keys do not work. ...
1
vote
1answer
499 views

Is it possible to change the key binding for completion in bash shell?

For bash, I would to modify the tab key for completion to the escape key. I know that key bindings are defined in /etc/inputrc. But I don't know if something like this could work: `"\e" : ...
5
votes
3answers
1k views

How do I switch to vi editing mode in readline?

I want to switch to vi editing mode in a readline environment. But I don't want to use 'set -o vi'. I want to temporarily switch using a keyboard shortcut. The man page says I can do this with ...
3
votes
1answer
379 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 ...
2
votes
1answer
324 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 ...
9
votes
2answers
2k views

Alt-Left to skip words does not work in terminal emulators

On a Debian Wheezy machine at previous job, I got used to Alt+Left and Alt+Right to skip between words on active command-line (in bash). However, since at home I have upgraded to Jessie (Debian 8.0, ...
1
vote
1answer
148 views

Simulating READLINE_LINE in Bash < 4.0

I am trying to make some of my code bash 3.X compatible and I have a key-binding that utilizes READLINE_LINE inside its callback function. 3.0 versions of Bash don't supply the READLINE_LINE, so I ...
11
votes
2answers
2k views

Is there any way to enable Ctrl+L to clear screen when 'set -o vi' is set?

When you press Ctrl+L in bash default mode the screen is cleared. But when I run set -o vi and press Ctrl+L the keystroke is printed (^L). Is there any way to keep this behavior?
4
votes
1answer
445 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 ...
2
votes
2answers
277 views

Why does Bash readline sometimes try to parse the second word of a command out of context?

I recently migrated all my dotfiles and setting to a new laptop running Ubuntu 13.04, and have been noticing a strange behavior that I've never seen before. Essentially, it seems like my terminal is ...
2
votes
2answers
245 views

Is it possible to assign multiple commands to a single hotkey? (bash, xterm)

Back in the day, if my cursor was in the middle of a really long shell command I'd just hit Ctrl+C to get myself a new command prompt. Then I learned about Ctrl+K/C and life was good. Unfortunately ...
1
vote
2answers
697 views

What kind of file does /etc/inputrc belong to?

Seems like that the /etc/inputrc file conforms to the shell script syntax. But the file name does not end with a .sh. The first line in the file does not have a #!, either. Is it another kind of ...
4
votes
3answers
771 views

Put text in the bash command line buffer

I would like to programmatically put a certain piece of text in the command line buffer of bash, read to be edited and used as a command. What I am looking forward to is something similar to read -i ...
3
votes
4answers
778 views

Shell: How do I get the last argument the previous command when it was detached?

Within the shell, typing ALT+. or using !$ recalls the last passed argument of the previous command. I use this all the time, but how do you do that when you detached the previous command? $ ...
7
votes
1answer
474 views

What are the readline word separators?

When I delete a "word" in Bash, it will stop at certain characters like _ and /. For example, if I type /foo/bar and activate backward-kill-word (typically mapped to Alt-Backspace and/or Ctrl-w), ...
11
votes
3answers
5k views

Where do I find a list of terminal key codes to remap shortcuts in bash?

For example: "\e[1;5C" "\e[Z" "\e-1\C-i" I only know bits and pieces, like \e stands for escape and C- for Ctrl, but what are these numbers (1) and letters (Z)? What are the ;, [ and - signs for? ...
4
votes
1answer
356 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! ...
2
votes
2answers
76 views

xinput - Ctrl+<Left> misbehaves if history-search-backward is mapped

I am using these lines in my ~/.inputrc: "\e[5~": history-search-backward "\e[6~": history-search-forward With these settings when I type c on the prompt and do a PageUp, bash only shows command ...
5
votes
3answers
1k views

Ctrl-a does not take me to the beginning of the prompt while I am working within a GNU screen

To navigate to the starting and end of a command, I usually use Ctrla and Ctrle. However, when I work within a GNU screen, those keybinding do not work becuase perhaps they are being used by the GNU ...
7
votes
1answer
5k views

Delete whole argument in current bash command-line

Using ^W (unix-word-rubout) I can easily delete a single "word" from the current command in my bash shell. However, when dealing with quoted arguments that contain spaces (or unquoted arguments ...
4
votes
2answers
125 views

Where does the yanked text on commadline get stored?

When you delete characters on the command line using readline commands (e.g. Ctrl-U, you can paste using Ctrl-y, but where does it get stored? It does not seem to use X11 clipboard at all.
2
votes
3answers
100 views

Ctrl+W in vi[m] to erase to whitespace

I want to mimic the functionality of bash readline in vim. Is there an easy way to do that? Currently in vim Ctrl+W "cuts" from cursor back to special char or whitespace. ie. In bash Ctrl+W "cuts" ...
1
vote
1answer
670 views

What is Bash's “Order of Operations” when parsing a command?

Given a command entered at a normal bash prompt, how does bash read that line once you hit enter? does it do variable substitution then command substitution? or does it do bash expansion first? or ...