Readline is a software library (part of the GNU Project) that provides line-editing and history capabilities for interactive programs with a command-line interface.
2
votes
3answers
62 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?
...
3
votes
1answer
40 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
21 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 ...
3
votes
3answers
72 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 ...
3
votes
1answer
102 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
78 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
72 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" ...
0
votes
1answer
95 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 ...
1
vote
0answers
55 views
Readline menu-complete on OS X
I'm trying to test out using the menu-complete on OS X 10.8, and it's just not working. I have it in my .inputrc as such:
"\M-s": menu-complete
I then tried to do C-x C-r to reload the .inputrc and ...
2
votes
3answers
154 views
How to read '\n' into variable with Bash's built-in command?
Somehow I'm not able to read the trailing \n sign into the REPLY variable. Under any circumstances I want to avoid a blank line that results from the \n being echoed by read but echo one in case of ...
2
votes
3answers
207 views
Configure up-arrow to browse through commands with same initial characters rather than all previous commands
On the bash command-line, ↑ gives me the previous command. On the command-lines in numpy or matlab, when I type a few characters, ↑ gives me the previously entered command starting with those ...
1
vote
1answer
67 views
C-u leaves ghost characters at command prompt in xterm
I am using bash (v3.2.25) on linux, through xterm, through exceed. When using Ctrlu the cursor is moved next to the bash character prompt ($) but the rest of the line remains and is not erased as ...
9
votes
1answer
184 views
Execute a readline function without keybinding?
I was just reading the readline man-page and disovered a bunch of great commands I didn't know about. However, several don't have default key bindings. Is there a way to execute the unbound commands ...
3
votes
1answer
86 views
read with history
How can I make the builtin read command support history, by pressing the up/down key to cycle through them?
I've tried catching when you press the up key, however it doesn't seem to work with read:
...
1
vote
1answer
111 views
How to create cross-platform keyboard bind commands?
I'd like to have the same keyboard shortcuts in all the terminals I use. Since they don't have the same *nix on them, and since terminals can be very different, I'm looking for a reasonably portable ...
2
votes
2answers
513 views
Reading character by character with bash read
I've been trying to use bash to read a file character by character.
After much trial and error, I have discovered that this works:
exec 4<file.txt
declare -i n
while read -r ch <&4;
...
2
votes
1answer
250 views
How to change readline's/bash's meta key?
Readline/bash use the meta key quite often but it only works when I use the Esc-key for it.
How can I configure bash/readline to accept a different key as meta?
6
votes
3answers
211 views
How to repeat currently typed in parameter on bash console?
I was just typing something along the lines of:
mv foo/bar/poit/zoid/narf.txt
and suddenly realized, damn, I have to type large parts of that parameter again
mv foo/bar/poit/zoid/narf.txt ...
2
votes
1answer
320 views
bash readline: Key binding that executes an external command
(Background: I'm a long-time tcsh user, gradually transitioning to bash, and trying to find equivalents for some useful tcsh-specific features.)
In tcsh, I can define a key binding that executes an ...
5
votes
3answers
346 views
Change $TERMINFO in bashrc script
I'm trying to set TERMINFO="$HOME/.terminfo" within my .bashrc script. The reason being is that my terminal isn't in the system terminfo location, and so I have its terminfo file in my home directory.
...
2
votes
2answers
372 views
Cannot enter a forward slash character when logging in via ssh
When I ssh into one of our servers, I cannot enter a forward slash character, which makes it difficult to do pretty much anything (like ls /). How can I get the forward slash to work?
Some ...
2
votes
1answer
214 views
readline: unix-word-rubout, but backwards, is it possible?
I'm trying to set up my .inputrc to perform a backwards unix-word-rubout but I'm currently failing at doing so.
I have M-w mapped in my .inputrc.
this does not work:
"\eu": universal-argument
"\ew": ...
4
votes
2answers
170 views
How to print keyboard shortcuts in human-readable form?
It would be very useful to have a user-friendly way to get an overview of the currently defined keyboard shortcuts. In other words, given the /etc/inputrc lines
"\e[A": history-search-backward
...
3
votes
2answers
329 views
Resuming screen with UTF8 enabled breaks character input
Overview of UTF8 screen re-attachment issues.
Problem:
Creating a screen that uses UTF8 works perfectly until re-attaching said screen session.
Steps:
ssh remothost
screen -U -S ttytter
[detach ...
1
vote
0answers
68 views
Disable tab autocompletion in interactive mode
I have set disable-completion on in my ~/.inputrc, however this doesn't affect php in interactive mode (php -a).
I would like to copy some code from another editor to the php interactive shell which ...
5
votes
1answer
260 views
history list in bash always truncated to 5000 lines at new login
Similar to the 5000 line limitation problem when first thing in .bashrc I have
export HISTSIZE=10001
and
export HISTFILESIZE=$HISTSIZE
My users do not have ~/.inputrc files and the system-wide ...
1
vote
0answers
124 views
Are there any editline configuration files available to make it act more like readline?
With editline replacing readline in a few software packages I use, the annoyance is growing at editline's behaviors and shortcomings. Is there someone maintaining a configuration file to at least make ...
8
votes
3answers
1k views
Advantages of using set -o vi
I have seen many developers using this command to set the option to vi. I never understood the real use of this?
When using bash commands, what help does switching to vi provide?
4
votes
2answers
1k views
How to remove last part of a path in bash? [duplicate]
Possible Duplicate:
How to delete part of a path in an interactive shell?
Is there a short-cut in bash that lets you delete the last part of a path?
Example: /usr/local/bin should become ...
1
vote
1answer
105 views
Tab and complete
Is the key binding for tab to complete in the readline settings set implicitly. Because when I outputted
bind -q complete
I got this in return
complete can be invoked via "\C-i", "\e\e".
...
5
votes
2answers
269 views
Setting readline variables in the shell
I read in the man page, that you set readline parameters on an off or to a value by using
set var value
Is this the same as the set builtin, and how do you set the variables once inputrc has already ...
3
votes
2answers
118 views
Why do different terminals have different values for keys in the .inputrc file?
This question really started from here. I would like to know why different terminals like rxvt and xterm use different values when mapping key combinations? Whilst I am in rxvt or xterm how can I find ...
6
votes
1answer
246 views
What is the general format of keyname for key bindings in “inputrc” file?
I understand that the format for key bindings in inputrc file is:
keyname: function-name or macro
For keyname, I saw things like:
"\e[B"
"\e[1~"
"\e[5D"
"\M-l"
"\C-[OD"
"\e\e[D"
What is the ...
0
votes
1answer
332 views
How can I make custom key bindings work even while SSH-ed into another machine?
I've added
"\eOD": backward-word
"\eOC": forward-word
to my .inputrc to get ctrl-arrow key mappings sorted out in Cygwin allowing me to move forward and back fine.
When I SSH to any other Linux ...
2
votes
1answer
161 views
How race conditions affect reads and writes (that happen at the same time)
Let's say I open a file a for reading. What if an application, let's call it aWriter writes to this file in random intervals. Are there any possibilities of me receiving improper file contents if I ...
2
votes
1answer
766 views
.inputrc TAB not behaving as expected
I'm on a roll today, here's another question:
How come when I put these into .inputrc, they both do the same thing?
TAB: menu-complete
Shift-TAB: menu-complete-reverse
i.e. they both do whatever ...
45
votes
2answers
16k views
How to unfreeze after accidentally pressing Ctrl-S in a terminal?
It's a situation that has happened quite often to me: after I press (with a different intention) Ctrl-S in a terminal, the interaction (input or output) with it is frozen. It's probably a kind of ...
7
votes
5answers
3k views
How do I install a PHP CLI with a usable interactive prompt on Debian Wheezy?
When I install php5-cli on Debian Wheezy (currently testing), the interactive prompt is very unusable due to missing readline support (bug 341868). What's the easiest way to install a version linked ...
1
vote
1answer
470 views
How do you configure .inputrc so ALT+UP has the effect of cd
It should be possible to do that by having ALT+UP generate consecutive keyboard input equivalent to cdspace..ENTER by means of a macro definition. But can't figure out how exactly to do it.
4
votes
1answer
261 views
Why is Vim eating up Ctrl when used with Ctrl+v and how to fix it?
I'm using Vim /etc/zsh/zshrc to add key bindings for zsh because it doesn't work with inputrc. In my terminal with tmux when I type Ctrl+v then Ctrl+LeftArrow the shell will show ^[OD. However, when ...
1
vote
1answer
347 views
VI mode in freetalk
I somehow managed to get my freetalk into vi-mode. I'm just unsure how I did it (if I restart freetalk I get an emacs-mode).
Anyone an idea?