# Typing 'Input' on Displayed Text

**URL:** <https://www.ruby-forum.com/t/typing-input-on-displayed-text/77501>\
**Category:** Ruby\
**Created:** [November 28, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/typing-input-on-displayed-text/77501 "2006-11-28T14:40:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodyee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/43a26b/32.png) [@woodyee](https://www.ruby-forum.com/u/woodyee)\
**Post date:** [November 28, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/typing-input-on-displayed-text/77501/1 "2006-11-28T14:40:58Z")

</div>

Hi! While shopping this weekend, I noticed lots of department stores  
using an older ‘template’ on the checkout registers which had info  
displaying and they simply typed in the info and entered or tabbed to  
the next field, sorta like this:

First Name: Last Name:  
Street: Town:  
City: State:

How can I do this in Ruby? I can do simple “Your name? (user writes  
name), then another question/user replies, another question/user  
replies” but how can I display text and have the user go through to the  
end? Hope this makes sense. Thanks!

---

<div class="post-metadata">

**Author:** ![woodyee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/43a26b/32.png) [@woodyee](https://www.ruby-forum.com/u/woodyee)\
**Post date:** [November 28, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/typing-input-on-displayed-text/77501/2 "2006-11-28T14:55:00Z")

</div>

On 11/28/06, woodyee [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How can I do this in Ruby? I can do simple “Your name? (user writes  
> name), then another question/user replies, another question/user  
> replies” but how can I display text and have the user go through to the  
> end? Hope this makes sense. Thanks!

You can do this sort of “fancy text terminal” in Ruby using libraries  
such as “curses” or “ncurses”, which are written in C and possess Ruby  
bindings. There’s a more elaborate library written in Ruby called  
Highline, IIRC, which seems to handle most of the fiddly detail for  
you. I also want to try this out some day, but I haven’t got around to  
it yet :).
