Questions tagged [readline]

A library for command line editing, or a function to read one line of text.

Readline may refer either the GNU readline library, used for editing a command line; or a function or method in various programming languages which typically reads a line of text from an open file handle.

GNU readline library

The gnu readline library provides applications with an interactive command prompt with features like

  • flexible command editing
  • configurable key bindings to mimic e.g. or
  • a history of past commands

Probably the most prominent application using readline is . Both packages are maintained by the same person. Many programming languages provide bindings for this library.

readline function

Examples of readline functions or methods include

(please extend this list if you know more languages using this name)

2233 questions
11
votes
6 answers

bash/readline equivalent of escape-dot in vi-mode

Having recently switched to vi-mode in bash, the one thing I miss is esc . to get the last argument of the last command. I know about ctrl _, but I always end up hitting ctrl - instead. Is there another vi-mode equivalent for this?
rouge8
  • 463
  • 2
  • 5
  • 17
11
votes
2 answers

How to avoid Python fileinput buffering

Possible Duplicate: Setting smaller buffer size for sys.stdin? I have a Python (2.4/2.7) script using fileinput to read from standard input or from files. It's easy to use, and works well except for one case: tail -f log | filter.py The problem…
John Zwinck
  • 239,568
  • 38
  • 324
  • 436
11
votes
2 answers

How to install R-packages not in the conda repositories?

I am using Anaconda to manage my R-installation. It works great for packages available in the R-channels provided by Anaconda, but I am having troubles installing packages not contained in the Anaconda repos. I have tried a few different approaches,…
joelostblom
  • 43,590
  • 17
  • 150
  • 159
11
votes
3 answers

Call to undefined function readline()?

I am integrating Dropbox into my PHP based website. When i try to run the following code. i got this Fatal error: Call to undefined function readline() on the last line. require_once "dropbox-sdk/Dropbox/autoload.php"; use \Dropbox as dbx; $appInfo…
M Fayyaz
  • 131
  • 1
  • 2
  • 7
11
votes
6 answers

Rails console: in `require': cannot load such file -- readline (LoadError)

I've got some errors in my Rails app and I'm trying to start the Rails console by issuing following command: rails console No matter what I try, I'm always getting the same…
Flock Dawson
  • 1,842
  • 4
  • 22
  • 34
11
votes
4 answers

C# - StreamReader.ReadLine does not work properly!

Simply I have been trying to implement what BufferedStreamReader does in Java. I have a socket stream open and just want to read it in a line-oriented fashion - line by line. I have the following server-code. while (continueProcess) { …
Aleyna
  • 1,857
  • 4
  • 20
  • 27
11
votes
3 answers

Changing word delimiters in bash

I want to change the delimiters bash (or readline) uses to separate words. Specifically I want to make '-' not delimit words, so that if I have the text ls some-file and I press Alt-Backspace it deletes the entire some-file text and not just up to…
drrlvn
  • 8,189
  • 2
  • 43
  • 57
10
votes
3 answers

using readline() for completion

I've got a question about Readline Library. I want to know if Readline can autocomplete filename from directories in a C program ? I've searched and only seen command name completion. thanks in advance. EDIT: I've copy filename in an array. These as…
lilawood
  • 2,263
  • 5
  • 22
  • 27
10
votes
3 answers

readline() is skipping lines in source file

I have a .txt file that I created with multiple lines. When I run a for loop, with a count accumulator, it skips lines. It skips the top line, and starts with the second, prints the fourth, the sixth, etc. What is it I'm missing? def main(): #…
Alli OGrady
  • 287
  • 3
  • 4
  • 13
10
votes
4 answers

Can the Perl debugger save the ReadLine history to a file?

I work quit a bit with lib ReadLine and the lib Perl Readline. Yet, the Perl debugger refuses to save the session command line history. Thus, each time I invoke the debugger I lose all of my previous history. Does anyone know how to have the Perl…
bitbucket
  • 1,171
  • 1
  • 9
  • 20
10
votes
2 answers

Tab completion interrupt for large binaries

If I accidentally launch tab completion when debugging large binary, gdb will freeze for some time scanning symbol table (up to 1 minute in my case). So I have to wait until whole symbol table is scanned. Is there any way to interrupt this process…
ks1322
  • 33,961
  • 14
  • 109
  • 164
10
votes
1 answer

Python hitting tab fails with Python AttributeError: module 'readline' has no attribute 'redisplay'

Using Python 3.7.3 (Anaconda) on Windows, hitting tab results in the following traceback: Readline internal error Traceback (most recent call last): File "C:\...\anaconda3\lib\site-packages\pyreadline\console\console.py", line 768, in…
wkzhu
  • 1,616
  • 13
  • 23
10
votes
1 answer

Python bug: null byte in input prompt

I've found that input('some\x00 text') will prompt for some instead of some text. From sources, I've figured out that this function uses C function PyOS_Readline, which ignores everything in prompt after NULL byte. From PyOS_StdioReadline(FILE…
Kostya Cholak
  • 192
  • 1
  • 10
10
votes
1 answer

Some characters stick to my colorized prompt in Python cmd

I am using Python 2's cmd module to make a command line for a program. Everything works nicely as long as I don't add color to my prompt. Working code: from cmd import Cmd class App(Cmd): def __init__(self): Cmd.__init__(self) …
RaminNietzsche
  • 2,683
  • 1
  • 20
  • 34
10
votes
4 answers

Rails 5 console needs readline 6 on macOS Sierra

I have only readline 7 installed and I can't find a single way to install version 6 on macOS Sierra. This is the error when trying to run rails c: …
Akash Agarwal
  • 2,326
  • 1
  • 27
  • 57