The Gnu readline library is used by other programs, such as shells and interpreters, to provide common line-editing capabilities.
Questions tagged [libreadline]
83 questions
1
vote
0 answers
forkpty + libreadline: auto completion issues
I have a small TCP client/server application in C and on Linux where a client can connect e.g. via telnet to a server-side cli. On the server, after accept is called, forkpty(3) is executed and traffic between master (pty) and the socket is…

user2638621
- 11
- 2
1
vote
0 answers
octave -> gnuplot error: shared library missing
Recently, I upgraded y octave to 3.6.2, but now I cannot plot a contour with [c, h] = contourf(x,y,z,[0:0.25:3]). The following error shows that gnuplot cannot load a shared library called libreadline.so.4
This file doesn't exists in my /var/lib/…

Vahid Mirjalili
- 6,211
- 15
- 57
- 80
0
votes
1 answer
Double prompt when handling signals with readline function in C
I am trying to write a minimal implementation of a shell for a school project. To write such an implementation I use the readline function and I have to handle SIGINT so that I display a new prompt on a new line when it occurs within the program…

lazydev
- 154
- 1
- 1
- 8
0
votes
0 answers
CMake import external library (GNU readline) using ExternalProject_Add()
I am really new (just a few weeks) to C and its bulding tools. Using the CMake documetation and some other guides I created a basic CMake project. This works as expectd.
Now I wanted to use some libraries in my project (GNU readline and cJSON).
The…

StuckPengiun
- 1
- 2
0
votes
1 answer
Why `bind -x '"$(tput kf5)":"pkill ffplay"'` take as same effect as `bind -x '"\e[15~":"pkill ffplay"'`?
bind command can bind a key sequence to a Readline function or a macro.The key sequence of f5 is \e[15~,i bind f5 with pkill.
ffplay movie.mp4
bind -x '"\e[15~":"pkill ffplay"'
Now press f5, the movie stop playing.
The expression $(command) stands…

showkey
- 482
- 42
- 140
- 295
0
votes
1 answer
"Neither readline nor libedit was found" on Raspbian 11 (bullseye)
I am trying to compile Ruby and I am getting the following:
root@raspberrypi:~/ruby-3.1.2# make -j4
...
linking ruby
make[2]: Leaving directory '/root/ruby-3.1.2'
make[1]: Leaving directory '/root/ruby-3.1.2'
make[1]: Entering directory…

Hackeron
- 616
- 7
- 14
0
votes
0 answers
How do you delete ^\ SIGQUIT characters from the terminal in C
So I'm trying to reproduce bash, and when I press control + \ in bash it does nothing. So I'm trying to reproduce that behavior this is my code.
# include
# include
# include
# include…

Sami
- 75
- 1
- 9
0
votes
1 answer
How to make libreadline or libedit cope with SIGALRM?
I am writing a Linux program that interacts with some custom hardware
via GPIO lines. It uses a timer periodically delivering SIGALRM in
order to manage the timing of these interactions, and there is quite
some work performed within the signal…

Edgar Bonet
- 3,416
- 15
- 18
0
votes
1 answer
How to change default C/C++ gnu readline newline character?
My goal is to use the C/C++ readline library on the telnet server-side as it delivers all necessary terminal functionality out of the box. Readline is already connected to the telnet socket, read and write to the socket works fine. I'm using…

Antoni
- 176
- 10
0
votes
1 answer
libreadline edit-and-execute-command support
In bash(and others) I can use C-x C-d or other keybindings to edit command using external editor defined in $EDITOR or $VISUAL.
However, when I use libreadline in my program, it doesn't have similar functionality by default.
How to enable it in my…

Uladzislau_Khamkou
- 150
- 7
0
votes
1 answer
python3 gnu redline minus-sign handling
I am writing a custom gnu readline completer and I found a strange quirk in handling the minus sign.
If my input is 'har' then the completer is called with the text 'har', however if my input is 'hard-r' the completer is called with text 'r'.
I am…

uuu777
- 765
- 4
- 21
0
votes
2 answers
Suppress printing a new prompt when pressing tab with Readline
When using the auto completion with the Readline library in C, the prompt is reprinted when typing the tab key twice:
(prompt) view NAME_OF_F (user presses tab twice)
NAME_OF_FILE1 NAME_OF_FILE2 (suggestions by Readline)
(prompt) view NAME_OF_F…

tham mes
- 19
- 2
0
votes
1 answer
Why is GNU Readline messing up ANSI color codes?
I'm trying to use GNU Readline with a colored prompt. Boiled down to a minimal test case, my readline() invocation looks like this:
readline("\x1b[34m" "prompt>" "\x1b[m");
I expected to see a prompt like this (just imagine it being…

lcmylin
- 2,552
- 2
- 19
- 31
0
votes
0 answers
How to fix input from readline from going to output stream
I'm making a project in C++ and was tasked with replacing the std::getline with the more capable readline() function from the readline.h library since it conatins more functionalitites and will be more useful overall. However the program I am…

Túlio Martins
- 1
- 1
0
votes
0 answers
C++ Console with concurrent output/input possibility
I am trying to create a simple project with an "interactive console" (might be the wrong term) where I can basically have input and output put onto the screen at the same time safely. I have been trying to use the GNU Readline program because I…

MasterGberry
- 2,800
- 6
- 37
- 56