# Highline and Termios issues

**URL:** <https://rubytalk.org/t/highline-and-termios-issues/60390>\
**Category:** ruby-talk\
**Created:** [10 October 2010 20:11 UTC](https://rubytalk.org/t/highline-and-termios-issues/60390 "2010-10-10T20:11:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://rubytalk.org/u/Ed_Howland)\
**Post date:** [10 October 2010 20:11 UTC](https://rubytalk.org/t/highline-and-termios-issues/60390/1 "2010-10-10T20:11:02Z")

</div>

Hi,

I have question re: Highline. In this code fragment, when running on MacOS/X:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agree("overwite #{path}? y/\<%= color('N', BOLD) %\>", true)  
{|q| q.default = false}

... The prompt is followed by a newline in irb/ruby. I can't see an  
option in the docs to change this behavior. I'm trying to emulate the  
question when copying a directory tree like the Rails command or its  
generators do.

Some searching led me to think that the Termios gem may help, but if I  
try to install it (Ruby 1.9.2-p0), I get this:

termios.c: In function ‘Termios\_to\_termios’:  
termios.c:182: error: ‘struct RArray’ has no member named ‘ptr’  
termios.c:183: error: ‘struct RArray’ has no member named ‘ptr’  
termios.c: In function ‘termios\_tcgetattr’:  
termios.c:200: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:200: error: (Each undeclared identifier is reported only once  
termios.c:200: error: for each function it appears in.)  
termios.c:200: error: ‘fptr’ undeclared (first use in this function)  
termios.c: In function ‘termios\_tcsetattr’:  
termios.c:224: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:224: error: ‘fptr’ undeclared (first use in this function)  
termios.c:231: warning: initialization discards qualifiers from  
pointer target type  
termios.c: In function ‘termios\_tcsendbreak’:  
termios.c:265: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:265: error: ‘fptr’ undeclared (first use in this function)  
termios.c: In function ‘termios\_tcdrain’:  
termios.c:290: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:290: error: ‘fptr’ undeclared (first use in this function)  
termios.c: In function ‘termios\_tcflush’:  
termios.c:313: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:313: error: ‘fptr’ undeclared (first use in this function)  
termios.c: In function ‘termios\_tcflow’:  
termios.c:343: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:343: error: ‘fptr’ undeclared (first use in this function)  
termios.c: In function ‘termios\_tcgetpgrp’:  
termios.c:374: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:374: error: ‘fptr’ undeclared (first use in this function)  
termios.c: In function ‘termios\_tcsetpgrp’:  
termios.c:398: error: ‘OpenFile’ undeclared (first use in this function)  
termios.c:398: error: ‘fptr’ undeclared (first use in this function)  
make: \*\*\* [termios.o] Error 1

Thanks (Snow Leopard, BTW)

Cheers,  
Ed

Ed Howland

> **[Green Programming - Blogging about Ruby, jQuery and Beyond!](https://greenprogrammer.wordpress.com/)**
>
> Just another WordPress.com weblog

  
[http://twitter.com/ed\_howland](http://twitter.com/ed_howland)

---

<div class="post-metadata">

**Author:** ![JEG2](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@JEG2](https://rubytalk.org/u/JEG2)\
**Post date:** [10 October 2010 20:22 UTC](https://rubytalk.org/t/highline-and-termios-issues/60390/2 "2010-10-10T20:22:33Z")

</div>

You just want to take the answer on the same line? Add some space after the prompt (at the end of your bold N) and HighLine should do the right thing for you.

Hope that helps.

James Edward Gray II

> **···**
>
> On Oct 10, 2010, at 3:11 PM, Ed Howland wrote:
> 
> > I have question re: Highline. In this code fragment, when running on MacOS/X:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agree("overwite #{path}? y/\<%= color('N', BOLD) %\>", true)  
> > {|q| q.default = false}
> > 
> > ... The prompt is followed by a newline in irb/ruby. I can't see an  
> > option in the docs to change this behavior.

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://rubytalk.org/u/Ed_Howland)\
**Post date:** [10 October 2010 22:24 UTC](https://rubytalk.org/t/highline-and-termios-issues/60390/3 "2010-10-10T22:24:55Z")

</div>

Thanks James.

Cheers,  
Ed

Ed Howland

> **[Green Programming - Blogging about Ruby, jQuery and Beyond!](https://greenprogrammer.wordpress.com)**
>
> Just another WordPress.com weblog

[http://twitter.com/ed\_howland](http://twitter.com/ed_howland)

> **···**
>
> On Sun, Oct 10, 2010 at 4:22 PM, James Edward Gray II \<james@graysoftinc.com\> wrote:
> 
> > On Oct 10, 2010, at 3:11 PM, Ed Howland wrote:
> > 
> > > I have question re: Highline. In this code fragment, when running on MacOS/X:
> > > 
> > > ```
> > > agree\(&quot;overwite \#\{path\}? y/&lt;%= color\(&#39;N&#39;, BOLD\) %&gt;&quot;, true\)
> > > 
> > > ```
> > > 
> > > {|q| q.default = false}
> > > 
> > > ... The prompt is followed by a newline in irb/ruby. I can't see an  
> > > option in the docs to change this behavior.
> > 
> > You just want to take the answer on the same line? Add some space after the prompt (at the end of your bold N) and HighLine should do the right thing for you.
> > 
> > Hope that helps.
> > 
> > James Edward Gray II
