Project

General

Profile

Actions

Bug #6950

closed

ruby-mode: comint-previous-input does not work

Added by cinsk (Seong-Kook Shin) over 12 years ago. Updated over 12 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
Backport:
[ruby-core:47367]

Description

On RVM irb with ruby 1.9.3-p194, the prompt is somewhat different from irb with ruby 1.8.x

On ruby 1.8, the prompt looks like:

irb(main):001:0> _

On ruby 1.9.x, the prompt looks like:

ruby-1.9.2-p180 :001 > _

Since misc/inf-ruby.el has regular expressions that only parse "irb(...)>" prompt,
M-p or M-n command do not work properly.

Solution:

  1. replace the initial value of 'inferior-ruby-first-prompt-pattern' and 'inferior-ruby-prompt-pattern' to
    following:

(defvar inferior-ruby-first-prompt-pattern "^\(?:irb(.*)[0-9:]+0\|ruby[-0-9.a-z]+ *:[0-9]+ *\)> *"
"first prompt regex pattern of ruby interpreter.")

(defvar inferior-ruby-prompt-pattern "^\(?:\(irb(.)[0-9:]+[>"'] *\)+\|ruby[-0-9.a-z]+ *:[0-9]+[ "']> *\)"
"prompt regex pattern of ruby interpreter.")

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0