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

Readline stops after 55 lines. How to read input from standard input in node js?

I have a "simple" problem that I cant seem to get around. Im just going to read input from standard input (terminal) and then save the input to a variable (here an array) and then print it all out to the terminal. When I try to paste in more than 55…
Zencha
  • 43
  • 1
  • 7
4
votes
0 answers

Remove items from iPython's history

Possible Duplicate: raw_input without leaving a history in readline I'm working on a simple interactive application that relies on iPython. I'm running into a problem where prompting a user for input (e.g. with raw_input()) adds the item to…
GDorn
  • 8,511
  • 6
  • 38
  • 37
4
votes
1 answer

System / pip readline versions mismatch

I am using a python 3.6 virtual environment and am having problems with the readline package. The system readline version is 8.0, while the pip package is $ pip list | grep readline gnureadline 6.3.8 This leads to trouble importing /…
npit
  • 2,219
  • 2
  • 19
  • 25
4
votes
1 answer

Python debugger with line edition in a program that uses stdin

To add an ad hoc debugger breakpoint in a Python script, I can insert the line import pdb; pdb.set_trace() Pdb reads from standard input, so this doesn't work if the script itself also reads from standard input. As a workaround, on a Unix-like…
Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
4
votes
2 answers

Wait for user input from readline module (Node.Js)

I am creating a module to get experience and shorten some code. I have a piece of code which uses readline in a simplified manner, like var x = arkin.question("How old are you? ");. Readline doesn't wait for the answer. It produces this: How old…
Arkin Solomon
  • 592
  • 1
  • 5
  • 23
4
votes
1 answer

undefined reference to "readline" in c file on ubuntu 18.04 (libreadline-dev installed, linked with "-lreadline"

I'm aware that there are many threads about this on Stackoverflow but non of the solutions helped me. I'm using Ubuntu 18.04 with all the stuff that a dev typically needs: build-essential, libreadline-dev, ... I had a look in /usr/include/readline…
phip1611
  • 5,460
  • 4
  • 30
  • 57
4
votes
1 answer

Why can't I "import * as readline from 'readline'" in Nodejs v10?

In the Nodejs docs, I see: import EventEmitter from 'events'; import { readFile } from 'fs'; import fs, { readFileSync } from 'fs'; https://nodejs.org/api/esm.html But with "readlines", I see: const readline =…
Steven Choi
  • 669
  • 6
  • 15
4
votes
1 answer

NodeJS "readline" module not outputting prompt

Using NodeJS, I was trying to make a 'note' manager just for fun, but when I tried to use readline.question() to get the user's input on what they would like to do(i.e create a new note, delete a note), the prompt wouldn't be displayed. Any…
Lite
  • 43
  • 4
4
votes
4 answers

Append String to each line of .txt file in python?

I want to append some text to every line in my file Here is my code filepath = 'hole.txt' with open(filepath) as fp: line = fp.readline() cnt = 1 while line: #.......... #want to append text "#" in every line by reading…
4
votes
1 answer

Term::Readline: encoding-question

When I enter "Müller", on the screen appears "M??ller". How could I fix this? #!/usr/bin/env perl use warnings; use 5.012; use Term::ReadLine; my $term = Term::ReadLine->new( 'dummy' ); my $con = $term->readline( ': ' ); say $con; # On the…
sid_com
  • 24,137
  • 26
  • 96
  • 187
4
votes
2 answers

C# - SerialPort.ReadLine() freezes my program

I'm trying to read messages sent form my Arduino over a Serial port using baud rate 9600. My Arduino code is programmed to send a "1" whenever I press a button and a "0" when I release my finger off the button. So it's not constantly sending…
SunAwtCanvas
  • 1,261
  • 1
  • 13
  • 38
4
votes
2 answers

string literal combination for colorized readline with string variable

Is it possible to put variable text_info to readline among with colors? GCC debuger gives me this error: " error: expected ‘)’ before 'text' #include #define CYELLOW "\001\e[0;31m\002" #define RESET "\001\e[0m\002" int…
test
  • 401
  • 1
  • 5
  • 15
4
votes
1 answer

How can I read partially entered text from bash?

When I enter some text and then Ctrl+R, the partially entered text appears in the reverse search prompt: > hello[Ctrl+R] (reverse-i-search)`': hello I'm looking to write a replacement for reverse search. The shortcut can be re-bound to run a…
jozxyqk
  • 16,424
  • 12
  • 91
  • 180
4
votes
2 answers

Hide console's user input after return/new line

What I'd like to do is hiding/erasing all users input from a nodejs console app once entered, so that when the user inserts some text and then types enter, he won't be able to read what he just entered in the console anymore (so basically remove the…
razorxan
  • 516
  • 1
  • 7
  • 20
4
votes
2 answers

Python how to remove newline from sys.stdin.readline()

I'm defining a function that concatenates two strings given by the user, but the string returned by sys.stdin.readline() includes the newline character so my output doesn't look concatenated at all (technically, this output is still concatenated,…
reiallenramos
  • 1,235
  • 2
  • 21
  • 29