# Irb weirdness

**URL:** <https://www.ruby-forum.com/t/irb-weirdness/136082>\
**Category:** Ruby\
**Created:** [April 28, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/irb-weirdness/136082 "2008-04-28T19:44:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 28, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/irb-weirdness/136082/1 "2008-04-28T19:44:36Z")

</div>

Has anybody else had this happen to them in irb?  
You run something in irb that outputs to the screen without a  
terminating \n  
then  
the cursor ends up in weird places.  
If you hit the up arrow it does weird, funky things  
ex: [after running something that threw an exception, then hitting the  
up arrow]

from (irb):11\>\> Program.create :name =\> ‘BSpment’, :program\_code =\>  
‘BSIT’, :is\_online =\>  
kape\_level\_id =\> 6, :school =\> 3  
^ the cursor is here.

Also another weirdness: sometimes in irb it ‘disallows’ you from  
adding input to the end of whatever line you’re typing on. [This may  
or may not be associated with hitting ctrl-e to get to the end of the  
line first]. You just can’t type. Backspace works, forward typing  
doesn’t.

Thoughts?  
-R

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 28, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/irb-weirdness/136082/2 "2008-04-28T20:05:59Z")

</div>

On 28.04.2008 19:43, Roger P. wrote:

> kape\_level\_id =\> 6, :school =\> 3  
> ^ the cursor is here.
> 
> Also another weirdness: sometimes in irb it ‘disallows’ you from  
> adding input to the end of whatever line you’re typing on. [This may  
> or may not be associated with hitting ctrl-e to get to the end of the  
> line first]. You just can’t type. Backspace works, forward typing  
> doesn’t.

I would assume that this is less an issue of IRB but rather of the  
combination terminal you are using and screen library. You did not  
mention operating system, Ruby version and terminal type.

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 28, 2008, 10:05pm UTC](https://www.ruby-forum.com/t/irb-weirdness/136082/3 "2008-04-28T22:05:47Z")

</div>

On 28.04.2008 20:57, Roger P. wrote:

> Good call.  
> Turns out that using xterm on the same computer and the bugs seem to  
> go away [versus OS X Terminal].

Might be related to terminal type propagation via SSH (I am assuming you  
tried remotely before). You can try to explicitly set TERM (e.g.  
“export TERM=xterm” in a bash).

> Seems to only happen in Terminal and I think in the win32 console.  
> Hmm.

Are you talking about different computers? First you mention Mac and  
now Win…

Cheers

robert

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 28, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/irb-weirdness/136082/4 "2008-04-28T20:58:25Z")

</div>

Good call.  
Turns out that using xterm on the same computer and the bugs seem to  
go away [versus OS X Terminal].

Seems to only happen in Terminal and I think in the win32 console.  
Hmm.  
-R

> I would assume that this is less an issue of IRB but rather of the  
> combination terminal you are using and screen library. You did not mention  
> operating system, Ruby version and terminal type.  
> 1.8.6.

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 29, 2008, 1:36am UTC](https://www.ruby-forum.com/t/irb-weirdness/136082/5 "2008-04-29T01:36:50Z")

</div>

This is on Mac OS localhost.  
I think you may have been onto something by blaming the Terminal  
program itself, as it seems to work in xterm.  
I mention windows as I believe I’ve run into this problem [and all the  
time] running a console in windows, though I don’t have one handy to  
test my hypothesis.

> Might be related to terminal type propagation via SSH (I am assuming you  
> tried remotely before). You can try to explicitly set TERM (e.g. “export  
> TERM=xterm” in a bash).  
> Unfortunately even this is not enough to help out OS X’s terminal 🙂

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 29, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/irb-weirdness/136082/6 "2008-04-29T19:58:04Z")

</div>

> I think you may have been onto something by blaming the Terminal  
> program itself, as it seems to work in xterm.  
> In Eterm + os x the ‘right arrow’ bug is there but not the new line  
> difficulty. Weird.
