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

user input in R (Rscript and Widows command prompt)

I am trying to figure out, how can i run an r script, using Rscript in windows command prompt and ask for user input. So far, i have found answers on how do ask for user input in R's interactive shell. Any effort in doing the same with readline()…
user1834437
5
votes
1 answer

readline then move the pointer back?

Is there a function in the streamreader that allows for peek/read the next line to get more information without actually moving the iterator to the next position? The action on the current line depends on the next line, but I want to keep the…
Yang
  • 6,682
  • 20
  • 64
  • 96
5
votes
2 answers

Python3: readline equavalent in select.select()

In a Python script, programmers can import readline which then gives input() extended abilities (readline has many other uses). I am wanting to use select.select() in my scripts instead of input() because I like the timeout feature. However, when…
Devyn Collier Johnson
  • 4,124
  • 3
  • 18
  • 39
5
votes
1 answer

How can I get native Vi mode in R to be persistent?

I have looked at the answers to vi input mode in R? and vi mode to emacs mode while on R. Through the latter question, I learned that meta-ctrl-j will work to toggle vi-mode in R, but I cannot get it to stick so that every time I start R, vi-mode…
merlin2011
  • 71,677
  • 44
  • 195
  • 329
5
votes
3 answers

Java sending message between server and client without newline character

I have a client which is connecting to a server. The server and the client exchange datas in string format. The problem is that, the server does not take '\n' character at the end of the message and because of this the client blocked in readLine()…
Genesist
  • 141
  • 2
  • 3
  • 7
5
votes
1 answer

Ruby Readline crashes console on up arrow

When I press the up or left arrow in the Rails console I get this bug: irb(main):001:0> /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in `block in _rl_dispatch_subseq': invalid byte sequence in UTF-8…
Ben G
  • 26,091
  • 34
  • 103
  • 170
5
votes
2 answers

Console.ReadLine is skipped

The C# Console.ReadLine() command is simply ignored when I run my code using mono filename.exe after having compiled it using gmcs filename.cs. What could be happening? Even when I try running the simple code bellow it skips right to the end as if…
user2142733
  • 71
  • 1
  • 6
5
votes
2 answers

Rails script/console crashes when I press up button because of bug in readline

This issue is intermittent, but pressing the up-arrow to get a previously entered command I'll get an error such as: /Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/whiny_nil.rb:52:in `method_missing': undefined…
Ben G
  • 26,091
  • 34
  • 103
  • 170
5
votes
1 answer

How make a twisted python client with readline functionality

I'm trying to write a client for simple TCP server using Python Twisted. Of course I pretty new to Python and just started looking at Twisted so I could be doing it all wrong. The server is simple and you're intended to use use nc or telnet. There…
Joel
  • 2,928
  • 2
  • 24
  • 34
5
votes
1 answer

Keyboard input between select() in Python

I write some codes to get the input from keyboard and also check something is alive or not: import sys from select import select timeout = 10 while is_alive(): # is_alive is a method to check some stuffs, might take 5 secs rlist, _, _ =…
justmaker
  • 53
  • 5
5
votes
1 answer

Perl Term::ReadLine::Gnu Signal Handling Difficulties

I'm using Term::ReadLine::Gnu and have run into a problem with signal handling. Given the script below and a TERM signal sent to the script, the handler for the TERM signal is not triggered until after the enter key is pressed. Using…
Sgt B
  • 1,211
  • 2
  • 11
  • 21
5
votes
3 answers

Adding colors to terminal prompt results in large white space

I'm working on a simple cli script and wanted to add some color to the following code: rl.question('Enter destination path: ', function(answer) { // ... …
5
votes
1 answer

raw_input without leaving a history in readline

Is there a way of using raw_input without leaving a sign in the readline history, so that it don't show when tab-completing?
lostgeek
  • 311
  • 1
  • 3
  • 8
4
votes
1 answer

Why don't all the readline shortcuts work in psql (or IRB, or the Rails console)?

In bash and zsh, you can use handy readline shortcuts like these to navigate between words, delete from the middle of the line, etc. However, only a couple of these (Ctrl-A and Ctrl-E and a couple of others) work in psql, IRB, and the Rails console…
yalestar
  • 9,334
  • 6
  • 39
  • 52
4
votes
2 answers

PHP readline() when STDIN other than keyboard

I'm writing an script that is able to read from stdin and then request for confirmation.
superruzafa
  • 701
  • 1
  • 7
  • 10