Questions tagged [readline]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
71 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, ...
1
vote
1answer
134 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 ...
2
votes
2answers
71 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. ...
3
votes
1answer
278 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
1answer
35 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 ...
1
vote
0answers
17 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 ...
2
votes
1answer
126 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
1answer
632 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....
5
votes
4answers
5k 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
0answers
179 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 ...
0
votes
1answer
824 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
2answers
364 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
2answers
94 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 ...
0
votes
0answers
93 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
1answer
56 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
0answers
89 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 ...
14
votes
4answers
5k 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....
4
votes
2answers
2k 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
1answer
703 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
1answer
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
1answer
163 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.
5
votes
0answers
283 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
2answers
261 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
1answer
137 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
2answers
235 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
1answer
279 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
0answers
216 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
1answer
184 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
2answers
368 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
65 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?...
7
votes
1answer
779 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
1answer
451 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
0answers
186 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 ...
3
votes
1answer
840 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
1answer
3k 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 ...
3
votes
1answer
694 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
1answer
891 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 ...
7
votes
4answers
2k 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
3answers
244 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 "...
3
votes
1answer
573 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
1answer
2k 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/...
4
votes
1answer
705 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
405 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
740 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 the ...
6
votes
1answer
2k 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 ...
2
votes
3answers
2k 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 (...
3
votes
2answers
843 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 ...
15
votes
3answers
4k 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 /home/myname/...
2
votes
1answer
402 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 ...
9
votes
1answer
3k 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 right=^[[...