# Interact with Ruby via command prompt window dynamically

**URL:** <https://www.ruby-forum.com/t/interact-with-ruby-via-command-prompt-window-dynamically/117272>\
**Category:** Ruby\
**Created:** [October 15, 2007, 3:27pm UTC](https://www.ruby-forum.com/t/interact-with-ruby-via-command-prompt-window-dynamically/117272 "2007-10-15T15:27:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [October 15, 2007, 3:27pm UTC](https://www.ruby-forum.com/t/interact-with-ruby-via-command-prompt-window-dynamically/117272/1 "2007-10-15T15:27:09Z")

</div>

Hi all,

I use SciTE for Ruby scripting. I wonder if it is possible to  
dynamically interact with my script via command prompt from within  
SciTE. For example I want to get user input and then print it to the  
command prompt window.

//script  
input=STDIN.gets  
puts input

It works if I execute the script from a prompt window but doesn’t work  
via SciTE. I wonder what is the Ruby way to interact with the user from  
the command prompt window.

Thanks,

Li

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [October 16, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/interact-with-ruby-via-command-prompt-window-dynamically/117272/2 "2007-10-16T19:50:22Z")

</div>

Li Chen schrieb:

> It works if I execute the script from a prompt window but doesn’t work  
> via SciTE. I wonder what is the Ruby way to interact with the user from  
> the command prompt window.

It does work for me.

> print("Enter some text: ")  
> $stdout.flush  
> input = gets  
> puts(“You entered \<#{input}\>”)
> 
> Running in SciTE it open a cmd prompt (where the ruby interpreter is  
> called).
> 
> Output goes to SciTE-output pane - so you can ignore the cmd-window.  
> Just switch back to SciTE to enter the data and see the output.

I did use the output-pane for entering the data.

Stefan
