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

No readline support while using pdb.set_trace()

I have an application running Python 2.6.X. Starting the Python interpreter in interactive mode (with or without using virtualenv): readline support working (command history). Starting my application with the same Python interpreter (virtualenv-ed…
user2665694
13
votes
2 answers

Complex keybinding in bash

Is there a way to combine two operations into one keybinding (dont think would work with function). This is what I'd like to do: I'd like a keybinding (say Ctrl-X) to - insert some text, then invoke the complete or menu-complete, using the…
nhed
  • 5,774
  • 3
  • 30
  • 44
13
votes
2 answers

What does the bash read -d '' do?

What does a -d '' do in a bash read command? The example is directly from a previous SO. From the usage printed by the read command, it says that the -d option defines the delimiter for splitting words in a line. What does an empty delimiter do?…
minghua
  • 5,981
  • 6
  • 45
  • 71
13
votes
3 answers

How can I get readline/rlwrap-like functionality when using clojure.main/repl?

How can I get readline-like (or rlwrap-like) functionality from my REPL when I use the repl function from clojure.main? The background to this is that I'm utilizing and customizing the break function from The Joy of Clojure, First Edition. I'm…
user457586
13
votes
6 answers

How to implement a python REPL that nicely handles asynchronous output?

I have a Python-based app that can accept a few commands in a simple read-eval-print-loop. I'm using raw_input('> ') to get the input. On Unix-based systems, I also import readline to make things behave a little better. All this is working fine. The…
andy
  • 18,005
  • 9
  • 30
  • 27
13
votes
4 answers

How to test Python readline completion?

I'm writing a command-line interface in Python. It uses the readline module to provide command history and completion. While everything works fine in interactive mode, I'd like to run automated tests on the completion feature. My naive first try…
Tony
  • 1,221
  • 2
  • 12
  • 25
13
votes
6 answers

Is there a simple alternative to Readline?

On a project I'm working on, I'm trying to make it accept user commands and provide history with the up arrow. I'm aiming to keep this project free of dependencies, and I don't want to have to require people to also install the readline development…
Justin Poliey
  • 16,289
  • 7
  • 37
  • 48
13
votes
5 answers

Cursor keys not working when using sqlite3 from adb shell

When using sqlite3 through adb shell arrow keys, instead of moving the cursor to the desired position or summoning the history facility, the following is showed in the screen: ^[[A, ^[[B, ^[[C, ^[[D. I'm using Mac OS X and I have tried Terminal and…
12
votes
2 answers

R - Reading STDIN line by line

I want to stream a big data table into R LINE BY LINE, and if the current line has a specific condition (lets say the first columns is >15), add the line to a data frame in memory. I have written following code: count<-1; Mydata<-NULL; fin <-…
user1250144
  • 201
  • 2
  • 5
12
votes
6 answers

Readline not working in rvm - Ubuntu 11.10

I am using rvm on my ubyntu 11.10. My readline is not working, I tried ruby extconf.rb but it is not passed. Output is bellow: $ ruby extconf.rb checking for tgetnum() in -lncurses... yes checking for readline/readline.h... yes checking for…
Sayuj
  • 7,464
  • 13
  • 59
  • 76
12
votes
7 answers

Delphi: Alternative to using Reset/ReadLn for text file reading

i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
12
votes
6 answers

What will give me something like ruby readline with a default value?

If I want to have a prompt on the terminal with a default value already typed in, how can I do that? Ruby's standard Readline.readline() lets me set the history but not fill in a default value (as far as I can tell, at least) I would like something…
jes5199
  • 18,324
  • 12
  • 36
  • 40
12
votes
2 answers

What is wrong with readline?

I set up a Rails environment three times with different OSes and with Rails 3 and 4. It goes smoothly until I open a console to type some Ruby, or inspect my database with rails console or rails dbconsole. I get something similar to: $ rails…
toftis
  • 1,070
  • 9
  • 26
12
votes
2 answers

How can I unbind and remap C-w in Bash?

I'd like to map Ctrl-w to kill-region in Bash 4.2. This key is bound to unix-word-rubout (delete word backward) by default. According to the manual, remapping should be possible with the bind command which has the options -u function Unbind…
malana
  • 5,045
  • 3
  • 28
  • 41
11
votes
2 answers

Reading CSV file in java adds space between each character

I'm reading a CSV file downloaded form google trend, here are the contents of file when opened in notepad (first two lines only): ferrari ferrari (std error) 0.735 2% When I read the file using readline the line read contains space between…
Uzair Farooq
  • 917
  • 3
  • 15
  • 25