4
votes
1answer
67 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
119 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
34 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
86 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" : ...
4
votes
2answers
306 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
169 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
162 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
544 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
97 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 ...
2
votes
2answers
183 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
166 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
383 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
397 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
425 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
290 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), ...
2
votes
2answers
63 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 ...
7
votes
1answer
3k 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 ...
2
votes
3answers
97 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
392 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 ...
3
votes
1answer
93 views

Mapping character keys

I really don't understand bash's use of control characters. I understand simple things like adding colors with escape sequences but am at a loss for how to do things like bind keys in .inputrc. For ...
2
votes
3answers
317 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 ...
4
votes
3answers
2k 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
147 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 ...
14
votes
1answer
444 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 ...
4
votes
1answer
127 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
143 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 ...
4
votes
2answers
2k 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; ...
3
votes
1answer
482 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?
7
votes
4answers
598 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 ...
3
votes
1answer
735 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
748 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
708 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
370 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": ...
5
votes
1answer
368 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 ...
7
votes
2answers
3k 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
178 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
581 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 ...
7
votes
1answer
550 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 ...
1
vote
1answer
492 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 ...
6
votes
1answer
1k 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 ...
4
votes
1answer
1k 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.