# Spacing issues when using Inferior-Ruby Emacs mode

**URL:** <https://www.ruby-forum.com/t/spacing-issues-when-using-inferior-ruby-emacs-mode/74230>\
**Category:** Ruby\
**Created:** [February 27, 2006, 5:28pm UTC](https://www.ruby-forum.com/t/spacing-issues-when-using-inferior-ruby-emacs-mode/74230 "2006-02-27T17:28:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Staiger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c6cbf5/32.png) [@Josh\_Staiger](https://www.ruby-forum.com/u/Josh_Staiger)\
**Post date:** [February 27, 2006, 5:28pm UTC](https://www.ruby-forum.com/t/spacing-issues-when-using-inferior-ruby-emacs-mode/74230/1 "2006-02-27T17:28:27Z")

</div>

Hello,

I’m seeing some rather strange behavior when using Inferior-Ruby-Mode in  
Emacs (on Windows XP).

It’s a bit difficult to describe what the problem is, but here goes.

Whenever I hit enter my cursor is positioned in the wrong place for the  
next prompt. Instead of being positioned just to the right of the ‘\>’,  
it is positioned one line below and slightly to the right of where it  
should be.

I’m not sure how this will display for everyone, but here is an example  
of what I’m seeing if I hit :test[ENTER]:test2[ENTER]:test3[ENTER]

irb(main):001:0\> :test  
:test  
:test  
irb(main):002:0\>  
:test2  
:test2  
:test2  
irb(main):004:0\>  
:test3  
:test3  
:test3

irb(main):006:0\>  
[cursor goes here]

As you can see, I’m also seeing another issue of evaluations echoing  
twice instead of just once.

Does anyone have any tricks for getting this to work nicely?

I’ve not changed the default (seemingly) relevant variables in  
inf-ruby.el:

(defvar ruby-program-name “irb --inf-ruby-mode”  
“\*Program invoked by the run-ruby command”)

(defvar inferior-ruby-first-prompt-pattern “^irb(.\*)[0-9:]+0\> \*”  
“first prompt regex pattern of ruby interpreter.”)

(defvar inferior-ruby-prompt-pattern “^\(irb(._)[0-9:]+[\>_"'] \*\)+”  
“prompt regex pattern of ruby interpreter.”)

and my enter key is bound to the default comint-send-input command.

Any help would be appreciated, (including a referall to a more  
emacs-focused list if necessary).

Thank you!

Josh Staiger

> **[Josh Staiger ☙](https://joshstaiger.org/)**
>
> The personal homepage of Josh Staiger
