Project

General

Profile

Actions

Bug #6950

closed

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

Added by cinsk (Seong-Kook Shin) about 12 years ago. Updated about 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.")

Updated by naruse (Yui NARUSE) about 12 years ago

  • Status changed from Open to Third Party's Issue

report it to emacs

Updated by drbrain (Eric Hodel) about 12 years ago

=begin
Additionally, perhaps your problem is your .irbrc? My irb prompt is unchanged since 1.8.7.

1.9.2-p290:

irb(main):001:0> RUBY_VERSION
=> "1.9.2"
irb(main):002:0> RUBY_PATCHLEVEL
=> 290

1.9.3-p194:

irb(main):001:0> [RUBY_VERSION, RUBY_PATCHLEVEL]
=> ["1.9.3", 194]

2.0.0-r36819

irb(main):001:0> [RUBY_VERSION, RUBY_REVISION]
=> ["2.0.0", 36819]

=end

Updated by regularfry (Alex Young) about 12 years ago

On 30/08/12 01:57, drbrain (Eric Hodel) wrote:

Issue #6950 has been updated by drbrain (Eric Hodel).

=begin
Additionally, perhaps your problem is your .irbrc? My irb prompt is unchanged since 1.8.7.

1.9.2-p290:

irb(main):001:0> RUBY_VERSION
=> "1.9.2"
irb(main):002:0> RUBY_PATCHLEVEL
=> 290

1.9.3-p194:

irb(main):001:0> [RUBY_VERSION, RUBY_PATCHLEVEL]
=> ["1.9.3", 194]

2.0.0-r36819

irb(main):001:0> [RUBY_VERSION, RUBY_REVISION]
=> ["2.0.0", 36819]

=end

This is RVM at work: https://rvm.io/workflow/irbrc/

$ rvm use system
Now using system ruby.

$ irb
irb(main):001:0>

$ rvm use 1.8.7-p302
Using /home/zander/.rvm/gems/ruby-1.8.7-p302

$ irb
1.8.7 :001 >

$ rvm use 1.9.3
Using /home/zander/.rvm/gems/ruby-1.9.3-p194

$ irb
1.9.3p194 :001 >

--
Alex


Bug #6950: ruby-mode: comint-previous-input does not work
https://bugs.ruby-lang.org/issues/6950#change-29104

Author: cinsk (Seong-Kook Shin)
Status: Third Party's Issue
Priority: Normal
Assignee:
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

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

Updated by regularfry (Alex Young) about 12 years ago

On 30/08/12 15:54, Alex Young wrote:

This is RVM at work: https://rvm.io/workflow/irbrc/

Oh, I should add that my .irbrc is empty here.

--
Alex

Updated by cinsk (Seong-Kook Shin) about 12 years ago

Many thanks. I'll modify the .irbrc right away.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0