# Highline and Termios issues

**URL:** <https://www.ruby-forum.com/t/highline-and-termios-issues/196284>\
**Category:** Ruby\
**Created:** [October 10, 2010, 10:16pm UTC](https://www.ruby-forum.com/t/highline-and-termios-issues/196284 "2010-10-10T22:16:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [October 10, 2010, 10:16pm UTC](https://www.ruby-forum.com/t/highline-and-termios-issues/196284/1 "2010-10-10T22:16:29Z")

</div>

Hi,

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

```
    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:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [October 10, 2010, 10:22pm UTC](https://www.ruby-forum.com/t/highline-and-termios-issues/196284/2 "2010-10-10T22:22:56Z")

</div>

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("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.

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 G. II

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [October 11, 2010, 12:34am UTC](https://www.ruby-forum.com/t/highline-and-termios-issues/196284/3 "2010-10-11T00:34:38Z")

</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 G. II
