editing on the command line

G

greg

I want to output some text to the the terminal and allow the user to
edit it. Like the ability you get when using irb and go back in the
history. Basically a readline but the outputted text would be
editable instead of a prompt. I cannot find any way to do this using
standard tools or with any libraries. Any help is greatly appreciated.
 
R

Robert Klemme

I want to output some text to the the terminal and allow the user to
edit it. Like the ability you get when using irb and go back in the
history. Basically a readline but the outputted text would be
editable instead of a prompt. I cannot find any way to do this using
standard tools or with any libraries. Any help is greatly appreciated.

If you are on some kind of Unix your favorite shell usually offers this
service. IIRC Ruby comes with readline built in, so you might be able
to use it from a Ruby program. Does that help?

Kind regards

robert
 
G

greg

I am looking for cross-shell/platform compatibility, but if there is a
way to delegate this task to the shell I would be interested in
knowing anyways.
It seems there are over ten IRC libraries, which one are you referring
too? I doubt those libraries would be doing anything other than the
standard Readline.readline though.
 
P

Phillip Gawlowski

I am looking for cross-shell/platform compatibility, but if there is a
way to delegate this task to the shell I would be interested in
knowing anyways.
It seems there are over ten IRC libraries, which one are you referring
too? I doubt those libraries would be doing anything other than the
standard Readline.readline though.

Firstly:
A: It messes with the readability of responses.
Q: Why is top-quoting bad?

Secondly:
IIRC == "If I Remember Correctly" != Internet Relay Chat.

Thirdly:
Readline.readline is what Robert Klemme meant, if I parse the thread
correctly.


--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/
http://clothred.rubyforge.org

Eek! That was supposed to be My Special Law, _MY_ special law, I tell
you!

T/
 
G

greg

Phillip said:
Firstly:
A: It messes with the readability of responses.
Q: Why is top-quoting bad?

Secondly:
IIRC == "If I Remember Correctly" != Internet Relay Chat.

Thirdly:
Readline.readline is what Robert Klemme meant, if I parse the thread
correctly.


--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/
http://clothred.rubyforge.org

Eek! That was supposed to be My Special Law, _MY_ special law, I tell
you!

T/

Readline.readline does not have this capability.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top