Questions tagged [libreadline]

The Gnu readline library is used by other programs, such as shells and interpreters, to provide common line-editing capabilities.

83 questions
1
vote
1 answer

GNU Readline: how to set the initial content of the input string

Colleagues, tell me how to set the initial value of the input line in readline()? Let's assume that I can guess with a high degree of probability what value the user will enter. Although, the likelihood of a different value remains. Therefore, I…
ogogon
  • 70
  • 5
1
vote
1 answer

R is missing libreadline.so.7 on Ubuntu 20.04, doesn't work anymore

Since I installed the latest version of Ubuntu (20.04), R (4.02) just doesn't work. If I try to launch R from the terminal I get the following message : R-4.0.2/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared…
user163731
  • 23
  • 1
  • 3
1
vote
0 answers

parse_and_bind() for keys other than

Is it possible to use "?" for tab-complete besides tab key in python? python allows to use key with parse_and_bind('tab: complete'), but I don't see any option for binding other keys like '?'; thanks
Pessy
  • 21
  • 1
1
vote
0 answers

Extend code.InteractiveInterpreter with a history, tab completion,

Is there an easy way to extend code.InteractiveInterpreter with a history, tab completion, ...? What I'm doing right now is subclassing code.InteractiveInterpreter to receive input from and transmit results to a different process. Now I'd like to…
dev15
  • 665
  • 3
  • 14
1
vote
1 answer

How to append history in editline?

I'm trying to add history appension to the MacPorts shell. MacPorts currently uses a bash-like history wherein the history is written after a session is over. This can be problematic if the session should crash, so I'm trying to make the MacPorts…
GDP2
  • 1,948
  • 2
  • 22
  • 38
1
vote
0 answers

How to run a function in the terminal everytime a key is pressed(bind the whole keyboard)

I have been playing with bash for the past week and would like to create a function that is called every time I press a key on the keyboard. I read about bind but it forces me to bind to a specific key. If anybody can assist me I would appreciate it…
amit
  • 113
  • 4
1
vote
1 answer

readline: remapping \C-m (Ctrl+m)

I want to have a custom binding for \C-m in my ~/.inputrc. However, the moment I replace it I can no longer enter any commands. E.g., "\C-m": vi-forward-word The problem seems to be that there exists a default binding "\C-m": accept-line That is…
deso
  • 11
  • 2
1
vote
1 answer

Recover last command beginning with a string in GNU/Octave's command line

I used to recover in Octave the last command beginning with a certain string by typing it and then pressing the up arrow key (likewise for Matlab). This behavior is not reproduced in my current Octave's command prompt (the raw one, as executed from…
nightcod3r
  • 752
  • 1
  • 7
  • 26
1
vote
1 answer

The best practice of CLI solution in go

I want to implement a program that provides interactive-shell like experience with CLI. I have been trying https://github.com/bobappleyard/readline but it needs users to install GNU readline and it causes some bugs in OSX. Is there any other…
John
  • 13
  • 2
1
vote
1 answer

Python + GNU/readline bindings: keep my sort order

GNU/readline seems to sort my data no matter what I do. My code code looks just like in the documentation: tags = [tag.lower() for tag in tags] def completer(text, state): text = text.lower() options = [tag for tag in tags if…
rr-
  • 14,303
  • 6
  • 45
  • 67
1
vote
2 answers

How to make readLine() timeout

My application basically is a CLI with all the expected features like prompt, history etc., it needs to wait on STDIN for user input. For this I am using readLine system call. I have a created a network socket which is used to send the message read…
Banu Prakash
  • 111
  • 9
1
vote
0 answers

libreadline SIGINT handler doesn't clear buffer

Having the little program below I expect the following: >> forget_me!^C >> next next >> But it really is: >> forget_me!^C >> next forget_me!next >> Shouldn't the default SIGINT handler clear the buffer as described here…
S1lentSt0rm
  • 1,989
  • 2
  • 17
  • 28
1
vote
1 answer

"libreadline" bugs getting in the way of bash scripts?

I was trying to convert a bash script to binary using shc. I put in a colored help page like this: #!/bin/bash if [ "$1" = "--help" ]; then echo -e "\e[0;31m———————————————\e[0m" echo -e "\e[0;33m Script help \e[0m" echo -e…
raumaan kidwai
  • 356
  • 1
  • 4
  • 14
1
vote
1 answer

Input not in correct format

I want to read a double value and a integer value from a console application in C#. ` int ch = Console.Read(); Console.WriteLine("Enter a random integer"); int x = int.Parse(Console.ReadLine()); …
sdwaraki
  • 382
  • 1
  • 4
  • 12
1
vote
1 answer

Perlbrew - installing Term::ReadLine::Gnu on OS X

Trying installing Term::ReadLine::Gnu on OS X. make test returns errors, like: t/00checkver.t .. 1/3 panic: free from wrong pool, 62696c2f62696c!=7f8ed2801200 during global destruction. After a searching found an advice compile perl with…
clt60
  • 62,119
  • 17
  • 107
  • 194