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
177
votes
7 answers

How to wait for a keypress in R?

I want to pause my R script until the user presses a key. How do I do this?
Contango
  • 76,540
  • 58
  • 260
  • 305
168
votes
3 answers

Convert InputStream to BufferedReader

I'm trying to read a text file line by line using InputStream from the assets directory in Android. I want to convert the InputStream to a BufferedReader to be able to use the readLine(). I have the following code: InputStream is; is =…
karse23
  • 4,055
  • 6
  • 29
  • 33
126
votes
7 answers

Press alt + numeric in bash and you get (arg [numeric]) what is that?

Press alt + numeric in bash and you get (arg [numeric]) what is that? (This type of question is better suited for asking a human, instead of trying to "guess" for the correct terminology to search on the documentation via internet).
dreftymac
  • 31,404
  • 26
  • 119
  • 182
115
votes
7 answers

How do I use vi keys in ipython under *nix?

Currently in Bash I use set -o vi to enable vi mode in my bash prompt. How do I get this going in ipython?
gak
  • 32,061
  • 28
  • 119
  • 154
88
votes
7 answers

Best method for reading newline delimited files and discarding the newlines?

I am trying to determine the best way to handle getting rid of newlines when reading in newline delimited files in Python. What I've come up with is the following code, include throwaway code to test. import os def getfile(filename,results): f =…
solarce
  • 1,195
  • 1
  • 9
  • 9
71
votes
19 answers

TAB completion does not work in Jupyter Notebook but fine in iPython terminal

TAB completion works fine in iPython terminal, but not in Firefox browser. So far I had tried but failed, 1). run a command $ sudo easy_install readline, then the .egg file was wrote in…
65
votes
4 answers

Control-r reverse-i-search in Bash: how do you "reset" the search in Cygwin?

How do you tell Ctrl + R reverse-i-search to "reset itself" and start searching from the bottom of your history every time? Background: When using reverse-i-search in Bash, I always get stuck once it is finished searching up through the history and…
dreftymac
  • 31,404
  • 26
  • 119
  • 182
61
votes
3 answers

What is the difference between File.ReadLines() and File.ReadAllLines()?

I have query regarding File.ReadLines() and File.ReadAllLines().what is difference between them. i have text file where it contains data in row-wise.File.ReadAllLines() return array and using File.ReadLines().ToArray(); will also i can get same…
sp_m
  • 2,647
  • 8
  • 38
  • 62
58
votes
12 answers

How to get synchronous readline, or "simulate" it using async, in nodejs?

I am wondering if there is a simple way to get "synchronous" readline or at least get the appearance of synchronous I/O in node.js I use something like this but it is quite awkward var readline = require('readline'); var rl =…
Colin D
  • 2,822
  • 1
  • 31
  • 38
52
votes
2 answers

Python REPL tab completion on MacOS

Before upgrading to lion, I had tab complete working in a python shell via terminal. Following these instructions, it was possible to have tab complete working. Since upgrading to Lion, I am now unable to get tab complete working in a terminal…
Josh Smeaton
  • 47,939
  • 24
  • 129
  • 164
52
votes
7 answers

Problems with the rails console, RVM and readline

I've installed rvm as a way of making sure that my local development version of ruby is the same as my server's for a particular app i work on (ruby 1.8.7). I've done this, and installed ruby 1.8.7 ok. However, when i try to start the rails…
Max Williams
  • 32,435
  • 31
  • 130
  • 197
51
votes
2 answers

How to delete a whole word on the right in Linux Bash Shell command line

How can I delete a whole word to the right in Linux Bash Shell command line? Such as this: Ctrl + U = Delete left of the cursor Ctrl + K = Delete right of the cursor Ctrl + W = Delete word on the left I want to know a shortcut to delete a whole…
Victor Lee
  • 2,467
  • 3
  • 19
  • 37
51
votes
3 answers

Python debugger (pdb) stopped handlying up/down arrows, shows ^[[A instead

I am using python 2.6 in a virtualenv on an Ubuntu Linux 11.04 (natty) machine. I have this code in my (django) python code: import pdb ; pdb.set_trace() in order to launch the python debugger (pdb). Up until today, this worked fine. But now when…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
50
votes
6 answers

Return to readline version 6.x in Homebrew to fix Postgresql?

I'm no Homebrew expert but I think it has "upgraded" me from readline version 6.x to 7.0 sometime after 9/15/16: eat@eric-macbook:Homebrew$ brew info readline readline: stable 7.0 (bottled) [keg-only] Library for command-line…
ericky
  • 1,641
  • 2
  • 14
  • 16
48
votes
1 answer

Node 'readline' module does not have an 'end' event - how can I do something when there are no more lines?

Reading the official docs for the readline module, there is no end event like other streams. Trying reader.on('end', cb); Doesn't work. How can I run a callback once there are no more lines to be read?
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
1
2 3
99 100