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
6
votes
2 answers

PrintWriter or any other output stream in Java do not know "\r\n"

I have trouble using PrintWriter or any other output stream to send message between server and client program. It works properly if I use println("abc") to communicate, but it does not work if I use print("abc\r\n"), print("abc\n") or…
Joey
  • 2,732
  • 11
  • 43
  • 63
6
votes
3 answers

Reading text from Amazon s3 stream

I use the following code to read text file from Amazon S3, and processing it line by line. This code works but the problem is it is slow. GetObjectRequest getObjRequest = new GetObjectRequest() .WithBucketName(amazonSettings.BucketName) …
Raed Alsaleh
  • 1,581
  • 9
  • 27
  • 50
6
votes
1 answer

How to avoid buffering in the Python fileinput library

I've seen this question asked here, but the answers given did not work in my case and was marked duplicate. python -u does not work for stdin in Python 3. sys.stdin = sys.stdin.detach() throws a ValueError: underlying buffer has been detached. None…
dpyro
  • 1,559
  • 2
  • 13
  • 19
6
votes
2 answers

Python - How to nest file read loops?

2 days ago I was first introduced to Python (and programming in general). Today I'm stuck. I've spent hours trying to find an answer to what I suspect is a problem so trivial, nobody else has yet been stuck here : ) The boss wants me to manually…
phlogiston
  • 63
  • 3
6
votes
3 answers

Is there a class that exposes an unbuffered readLine method in Java?

I'm cleaning up some chunks of our codebase at work, and one of the older classes is used to read and write data. This data is a mixture of US-ASCII encoded Strings and binary encoded primitives. The current implementation uses DataInputStream, but…
Doug Stephen
  • 7,181
  • 1
  • 38
  • 46
6
votes
6 answers

Cannot easy_install readline for Python 2.7.3 on Mac Os Lion

I am trying to install the python readline module. I have already installed readline via homebrew. If I type easy_install readline I get Downloading…
user11170
  • 163
  • 1
  • 3
6
votes
1 answer

Command history in mysql client only showing last line of multiline query

I'm using Mysql's command-line client in Screen/Tmux, from Bash in OSX's Terminal.app. When using arrow-up to re-display a previously run query that spanned more than on line, AND when the cursor is on the very last line of the Terminal, the command…
klokop
  • 2,414
  • 2
  • 18
  • 22
5
votes
3 answers

no such file to load -- readline (Load Error)

When I want to execute Rails 3 console, it throws this: $ script/rails c /usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (Load Error) I tried to install libreadline-dev: $ sudo…
Israel
  • 3,252
  • 4
  • 36
  • 54
5
votes
2 answers

How to provide a default answer to readline in node.js

js in order to create a command line wizard. The wizard asks some question to the user using the rl.question(query, callback) method. The problem is that I want to make the question and to provide a default answer in order to let the user able to…
Fab
  • 168
  • 2
  • 8
5
votes
1 answer

Python readline tab-completion in cmd.Cmd, when sys.stdout has been replaced

Currently, I have an application which uses the cmd.Cmd module for the command line interface, tab-completion works perfectly. Now, I'd like to replace sys.stdout, with another object (For example, in order to capture what's being…
5
votes
1 answer

How to write interactive shell with readline support in scala?

I want to write interactive shell in scala, with support for readline (Ctrl-l, arrow keys, line editing, history, etc.). I know how to do it in python: # enable support for Ctrl-l, arrow keys, line editing, history, etc. import readline finished =…
Hristo Hristov
  • 4,021
  • 4
  • 25
  • 37
5
votes
3 answers

subprocess readline hangs waiting for EOF

I have a simple c++ program that I'm trying to execute through a python script. (I'm very new to writing scripts) and I'm having trouble reading output through the pipe. From what I've seen, it seems like readline() won't work without EOF, but I…
Ryan Haining
  • 35,360
  • 15
  • 114
  • 174
5
votes
5 answers

ReadLine() vs Read() to Get CR and LF Efficiently?

I am working on a C# program to determine the line length for each row in multiple large text files with 100,000+ rows before importing using an SSIS package. I will also be checking other values on each line to verify they are correct befor…
buzzzzjay
  • 1,140
  • 6
  • 27
  • 54
5
votes
3 answers

In python, How do I check the stdout from a subprocess.Popen object for anything to read?

In python, How do I check the stdout from a subprocess.Popen object for anything to read? I'm writing a wrapper around a tool that sometimes runs for hours on-end. Using .readline() on the stdout from the child process is severely cutting in to the…
5
votes
0 answers

Readline does not read user config specified in INPUTRC variable

I am trying to change the location of my inputrc. The docs say that it reads the config location from the INPUTRC environment variable Readline is customized by putting commands in an initialization file (the inputrc file). The name of this file is…
tyagdit
  • 138
  • 5