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
17
votes
4 answers

Readline: Get a new prompt on SIGINT

I've got code similar to the following, using readline: #include #include #include #include #include #include #include #include #include…
Vishal Kotcherlakota
  • 1,134
  • 4
  • 13
  • 36
16
votes
4 answers

Pasting text into IRB is incredibly slow. Readline issue?

When I paste the following text into IRB or PRY running under ruby-enterprise-2011.03, it takes 13 seconds. # Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pasting isn't…
John Douthat
  • 40,711
  • 10
  • 69
  • 66
16
votes
2 answers

Python readline with custom delimiter

novice here. I am trying to read lines from a file, however a single line in a .txt file has a \n in the middle somewhere and while trying to read that line with .readline python cuts it in the middle and outputs as two lines. when I copy and past…
hgv
  • 227
  • 1
  • 2
  • 5
16
votes
4 answers

What is the equivalent of 'fread' from Matlab in Python?

I have practically no knowledge of Matlab, and need to translate some parsing routines into Python. They are for large files, that are themselves divided into 'blocks', and I'm having difficulty right from the off with the checksum at the top of the…
Duncan Tait
  • 1,997
  • 4
  • 20
  • 24
16
votes
3 answers

Lightweight GNU readline alternative

I am looking for a GNU readline alternative. It comes with a lot of features but only couple of them are useful to me as explained below - I am working on a interactive command prompt application (display prompt and accept next user command to be…
punekr12
  • 653
  • 2
  • 7
  • 14
15
votes
2 answers

show-all-if-ambiguous vs show-all-if-unmodified?

I couldn't find a clear explanation of the difference between the Readline options show-all-if-ambiguous and show-all-if-unmodified, and whether they affected different things or were mutually exclusive. The official documentation is sparse on the…
Kvass
  • 8,294
  • 12
  • 65
  • 108
15
votes
1 answer

undefined reference to `readline'

I'm having a problem trying to run the GNU Readline library sample code available in wikipedia. Here it goes: #include #include #include #include #include int main() { …
E.Z.
  • 6,393
  • 11
  • 42
  • 69
14
votes
4 answers

Make error installing Ruby 1.9.2 with RVM and Readline under OSX Lion

I'm having extensive problems getting rvm to work again under OSX Lion. Unsurprisingly, it seems to be a problem with readline, which is noted in several places. HOWEVER, (and this is an update) it seems that readline itself is not being installed…
TLK
  • 1,770
  • 1
  • 17
  • 32
14
votes
2 answers

pip installing ipython with readline on OSX Lion

What is required to get ipython fully functional on OSX Lion? I'm trying to get ipython with readline working and having no success. My approach: (inside a virtual environment) pip install ipython # runs, but only slightly useful because can't…
golliher
  • 1,377
  • 3
  • 12
  • 31
14
votes
3 answers

How can I clear the rails console history

When I run rails c and press the up key when irb starts up, I can see the last commands I entered when my app dropped to irb after encountering a debugger command for the ruby-debug gem. I would not only like to clear these commands out, but I would…
Aaron
  • 13,349
  • 11
  • 66
  • 105
14
votes
6 answers

Listen on ESC while reading Console line

I want to read an users input into a string while still reacting on ESC press at any time, but without defining a system wide hotkey. So when the user types e. g. "Test Name" but instead of confirming with ENTER presses ESC he should be led back…
AstronAUT
  • 639
  • 2
  • 7
  • 11
14
votes
1 answer

Node.js multiline input

I'd like to prompt the user for input, let the user enter multiple lines of text, hitting enter between each line, then terminate the input by pressing CTRL+D or some such thing. With "keypress", I can catch the EOF, but I would have to handle all…
Rich Remer
  • 2,123
  • 1
  • 21
  • 22
14
votes
2 answers

yum showing readline installed but readline command not working

yum My system shows readline installed rlwrap-0.41]$ sudo yum install readline Loaded plugins: fastestmirror, presto, security Loading mirror speeds from cached hostfile . . . Package readline-6.0-4.el6.x86_64 already installed and latest…
Akshay Hiremath
  • 950
  • 2
  • 12
  • 34
14
votes
4 answers

python read() from stdout much slower than reading line by line (slurping?)

I have a python SubProcess call that runs an executable and pipes the output to my subprocess stdout. In cases where the stdout data is relatively small (~2k lines), the performance between reading line by line and reading as a chunk (stdout.read())…
PaulD
  • 615
  • 1
  • 8
  • 15
14
votes
7 answers

Is StreamReader.Readline() really the fastest method to count lines in a file?

While looking around for a while I found quite a few discussions on how to figure out the number of lines in a file. For example these three: c# how do I count lines in a textfile Determine the number of lines within a text file How to count lines…
sergeidave
  • 662
  • 4
  • 11
  • 23