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
5
votes
1 answer

require Readline - You cannot create an instance of this type (Readline)

When I run this code require Readline; my $rl = Readline.new; my $string = $rl.readline( ':'); $string.say; I get this error-message: You cannot create an instance of this type (Readline) When I use useto load Readline it works. Why does require…
sid_com
  • 24,137
  • 26
  • 96
  • 187
5
votes
5 answers

Python readline from pipe on Linux

When creating a pipe with os.pipe() it returns 2 file numbers; a read end and a write end which can be written to and read form with os.write()/os.read(); there is no os.readline(). Is it possible to use readline? import os readEnd, writeEnd =…
tMC
  • 18,105
  • 14
  • 62
  • 98
5
votes
1 answer

Undefined reference to "tputs" on compiling Readline

I want compile install readline library on Ubuntu. I do the following: wget http://git.savannah.gnu.org/cgit/readline.git/snapshot/readline-8.0.tar.gz tar -zxvf readline-8.0.tar.gz cd readline-8.0 ./configure --prefix=`pwd`/readline make make…
Yunbin Liu
  • 1,484
  • 2
  • 11
  • 20
5
votes
4 answers

Readline C: force return of certain text in readline()

I am trying to allow an interrupt to cause a certain value to be returned by readline. Here is a minimal example: #include #include #include void handler (int status) { rl_replace_line("word",0); …
Zach
  • 53
  • 4
5
votes
1 answer

Handling very large text files using TStreamReader and TStringList

I am using Embarcadero's Rad Studio Delphi (10.2.3) and have encountered a memory issue while reading in very large text files (7 million lines+, every line is different, lines can be 1 to ~200 characters in length, etc.). I am fairly new at Delphi…
Ric Crooks
  • 91
  • 1
  • 9
5
votes
1 answer

How to make readline work in a python subprocess?

I have spent quite something enabling readline support in pdb on MacOS Sierra in a subprocess which I don't understand why it fails, hence the question. Please note that I have proper readline support without adding a .pdbrc file in all my python…
mehdix
  • 4,984
  • 1
  • 28
  • 36
5
votes
4 answers

Difference between readline vs fread/fgets in php

I have always used readline in my console commands before, but today I've come across the fread and fgets functions and my question is: what is the difference in using these two approaches: // first $inputLine = readline(); // second $inputLine =…
hvertous
  • 1,133
  • 11
  • 25
5
votes
2 answers

Why does irb insert control characters into my reverse-interactive-search buffer?

If I do a reverse interactive search in irb and then enter a control character (arrow keys are the only ones I've seen this with actually). So I start with this session: $ irb >> print "hello" hello then enter ^r, h $ irb >> print…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
5
votes
3 answers

How do I make IPython organize tab completion possibilities by class?

When an object has hundreds of methods, tab completion is hard to use. More often than not the interesting methods are the ones defined or overridden by the inspected object's class and not its base classes. How can I get IPython to group its tab…
joeforker
  • 40,459
  • 37
  • 151
  • 246
5
votes
2 answers

Is it possible to add multiple commands to the readline .inputrc file?

I'm trying to configure my Terminal and I would like to insert @{} at one key-stroke. This works with the following code # .inputrc "\e\"": "@{}" But I also want the cursor to end up inside the braces. How can I do this? The following doesn't…
andersjanmyr
  • 11,302
  • 5
  • 29
  • 29
5
votes
0 answers

How to correctly link patched GNU readline library to all existing programs?

My original issue was that I wanted a way to distinguish between whether I am in vi-command mode or vi-insert mode while using bash in vi-mode. I understand that as of GNU readline 7.0 there is a way to set an indicator in the command prompt;…
jinscoe123
  • 1,467
  • 14
  • 24
5
votes
2 answers

Write Hebrew Characters on Console Window, C#

How can the user be able to write Hebrew Characters in console window which appears now to show question marks, This is what I Have: Encoding hebrewEncoding = Encoding.GetEncoding("Windows-1255"); Console.InputEncoding =…
Mayer Spitz
  • 2,577
  • 1
  • 20
  • 26
5
votes
2 answers

C Function is deprecated

I used the code in below link: Readline Library And I defined a struct like this typedef struct { char *name; /* User printable name of the function. */ Function *func; /* Function to call to do the job. */ char *doc; …
JasonChiuCC
  • 111
  • 1
  • 6
5
votes
1 answer

No Readline Support in Python 2.7

I'm not getting any readline functionality in my python interactive sessions. Arrow keys just move the cursor around the screen or print ^[[A etc. Some web searching led me to try to manually import the readline package, but this resulted in the…
Empiromancer
  • 3,778
  • 1
  • 22
  • 53
5
votes
1 answer

Python: How can I use GNU readline when the value of sys.stdin has been changed?

I want my Python program to take input from a pipe and later take input from the terminal. After reading this SO post, I tried opening /dev/tty to replace sys.stdin. import sys import readline def tty_input(prompt): with open("/dev/tty") as…
Wren
  • 123
  • 2
  • 4