ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:102487] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
@ 2021-02-14 13:29 radek.bulat
  2021-02-14 14:56 ` [ruby-core:102488] " radek.bulat
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: radek.bulat @ 2021-02-14 13:29 UTC (permalink / raw)
  To: ruby-core

Issue #17629 has been reported by radarek (Radosław Bułat).

----------------------------------------
Bug #17629: macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
https://bugs.ruby-lang.org/issues/17629

* Author: radarek (Radosław Bułat)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
**Description**

If Ruby's readline extension is linked with libedit library and readline history is populated before `Readline.readline` method is called then items are not available via history navigation mechanism (`up/down` arrows).

**How to reproduce**

**bug.rb** (also attached to this issue)
``` ruby
require 'readline'

# calling below code before populating history will make it work
Readline.readline('press enter to continue', false) if ENV['WORKAROUND'] == '1'

Readline::HISTORY << 'Line1'
puts "History: #{Readline::HISTORY.to_a}"
Readline.readline('> ', true)
```

```
$ ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
History: ["Line1"]
> # pressing up arrow doesn't show entries from history

$ WORKAROUND=1 ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
press enter to continue
History: ["Line1"]
> Line1 # up arrow was pressed here and entry from history was shown up
```

Bug affects for example `pry` gem (history doesn't work).

**My setup**

```
macOS 11.2.1 Big Sur
architecture: arm64 (apple M1 processor)
ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]

readline extension linkage:
otool -L /Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle
/Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle:
	/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
```

---Files--------------------------------
bug.rb (271 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:102488] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
  2021-02-14 13:29 [ruby-core:102487] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it radek.bulat
@ 2021-02-14 14:56 ` radek.bulat
  2021-09-28 23:23 ` [ruby-core:105476] " radarek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: radek.bulat @ 2021-02-14 14:56 UTC (permalink / raw)
  To: ruby-core

Issue #17629 has been updated by radarek (Radosław Bułat).

File Dockerfile added

I added `Dockerfile` with instruction to build ruby with libedit library to reproduce this bug more easier.

```
docker docker build -t readline-bug . # run inside directory with Dockerfile and bug.rb files
```

To reproduce bug:

```
docker run --rm -it -v $PWD:/app readline-bug /opt/bin/ruby /app/bug.rb
docker run --rm -it -v $PWD:/app -e WORKAROUND=1 readline-bug /opt/bin/ruby /app/bug.rb
```

----------------------------------------
Bug #17629: macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
https://bugs.ruby-lang.org/issues/17629#change-90382

* Author: radarek (Radosław Bułat)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
**Description**

If Ruby's readline extension is linked with libedit library and readline history is populated before `Readline.readline` method is called then items are not available via history navigation mechanism (`up/down` arrows).

**How to reproduce**

**bug.rb** (also attached to this issue)
``` ruby
require 'readline'

# calling below code before populating history will make it work
Readline.readline('press enter to continue', false) if ENV['WORKAROUND'] == '1'

Readline::HISTORY << 'Line1'
puts "History: #{Readline::HISTORY.to_a}"
Readline.readline('> ', true)
```

```
$ ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
History: ["Line1"]
> # pressing up arrow doesn't show entries from history

$ WORKAROUND=1 ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
press enter to continue
History: ["Line1"]
> Line1 # up arrow was pressed here and entry from history was shown up
```

Bug affects for example `pry` gem (history doesn't work).

**My setup**

```
macOS 11.2.1 Big Sur
architecture: arm64 (apple M1 processor)
ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]

readline extension linkage:
otool -L /Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle
/Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle:
	/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
```

---Files--------------------------------
bug.rb (271 Bytes)
Dockerfile (340 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:105476] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
  2021-02-14 13:29 [ruby-core:102487] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it radek.bulat
  2021-02-14 14:56 ` [ruby-core:102488] " radek.bulat
@ 2021-09-28 23:23 ` radarek
  2021-09-29  2:26 ` [ruby-core:105481] " nobu (Nobuyoshi Nakada)
  2022-01-29 19:30 ` [ruby-core:107348] " radarek
  3 siblings, 0 replies; 5+ messages in thread
From: radarek @ 2021-09-28 23:23 UTC (permalink / raw)
  To: ruby-core

Issue #17629 has been updated by radarek (Radosław Bułat).


I believe this ticket can be closed as it is fixed in master branch. @nobu, Thank you for fixing this!


----------------------------------------
Bug #17629: macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
https://bugs.ruby-lang.org/issues/17629#change-93925

* Author: radarek (Radosław Bułat)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
**Description**

If Ruby's readline extension is linked with libedit library and readline history is populated before `Readline.readline` method is called then items are not available via history navigation mechanism (`up/down` arrows).

**How to reproduce**

**bug.rb** (also attached to this issue)
``` ruby
require 'readline'

# calling below code before populating history will make it work
Readline.readline('press enter to continue', false) if ENV['WORKAROUND'] == '1'

Readline::HISTORY << 'Line1'
puts "History: #{Readline::HISTORY.to_a}"
Readline.readline('> ', true)
```

```
$ ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
History: ["Line1"]
> # pressing up arrow doesn't show entries from history

$ WORKAROUND=1 ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
press enter to continue
History: ["Line1"]
> Line1 # up arrow was pressed here and entry from history was shown up
```

Bug affects for example `pry` gem (history doesn't work).

**My setup**

```
macOS 11.2.1 Big Sur
architecture: arm64 (apple M1 processor)
ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]

readline extension linkage:
otool -L /Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle
/Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle:
	/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
```

---Files--------------------------------
bug.rb (271 Bytes)
Dockerfile (340 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:105481] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
  2021-02-14 13:29 [ruby-core:102487] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it radek.bulat
  2021-02-14 14:56 ` [ruby-core:102488] " radek.bulat
  2021-09-28 23:23 ` [ruby-core:105476] " radarek
@ 2021-09-29  2:26 ` nobu (Nobuyoshi Nakada)
  2022-01-29 19:30 ` [ruby-core:107348] " radarek
  3 siblings, 0 replies; 5+ messages in thread
From: nobu (Nobuyoshi Nakada) @ 2021-09-29  2:26 UTC (permalink / raw)
  To: ruby-core

Issue #17629 has been updated by nobu (Nobuyoshi Nakada).

Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN to 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN

The auto close didn’t seem to work somehow.

----------------------------------------
Bug #17629: macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
https://bugs.ruby-lang.org/issues/17629#change-93930

* Author: radarek (Radosław Bułat)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
**Description**

If Ruby's readline extension is linked with libedit library and readline history is populated before `Readline.readline` method is called then items are not available via history navigation mechanism (`up/down` arrows).

**How to reproduce**

**bug.rb** (also attached to this issue)
``` ruby
require 'readline'

# calling below code before populating history will make it work
Readline.readline('press enter to continue', false) if ENV['WORKAROUND'] == '1'

Readline::HISTORY << 'Line1'
puts "History: #{Readline::HISTORY.to_a}"
Readline.readline('> ', true)
```

```
$ ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
History: ["Line1"]
> # pressing up arrow doesn't show entries from history

$ WORKAROUND=1 ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
press enter to continue
History: ["Line1"]
> Line1 # up arrow was pressed here and entry from history was shown up
```

Bug affects for example `pry` gem (history doesn't work).

**My setup**

```
macOS 11.2.1 Big Sur
architecture: arm64 (apple M1 processor)
ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]

readline extension linkage:
otool -L /Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle
/Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle:
	/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
```

---Files--------------------------------
bug.rb (271 Bytes)
Dockerfile (340 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:107348] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
  2021-02-14 13:29 [ruby-core:102487] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it radek.bulat
                   ` (2 preceding siblings ...)
  2021-09-29  2:26 ` [ruby-core:105481] " nobu (Nobuyoshi Nakada)
@ 2022-01-29 19:30 ` radarek
  3 siblings, 0 replies; 5+ messages in thread
From: radarek @ 2022-01-29 19:30 UTC (permalink / raw)
  To: ruby-core

Issue #17629 has been updated by radarek (Radosław Bułat).


Can someone close this ticket? I don't see a possibility to do it myself.

----------------------------------------
Bug #17629: macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it
https://bugs.ruby-lang.org/issues/17629#change-96246

* Author: radarek (Radosław Bułat)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
**Description**

If Ruby's readline extension is linked with libedit library and readline history is populated before `Readline.readline` method is called then items are not available via history navigation mechanism (`up/down` arrows).

**How to reproduce**

**bug.rb** (also attached to this issue)
``` ruby
require 'readline'

# calling below code before populating history will make it work
Readline.readline('press enter to continue', false) if ENV['WORKAROUND'] == '1'

Readline::HISTORY << 'Line1'
puts "History: #{Readline::HISTORY.to_a}"
Readline.readline('> ', true)
```

```
$ ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
History: ["Line1"]
> # pressing up arrow doesn't show entries from history

$ WORKAROUND=1 ~/opt/ruby/bin/ruby -v bug.rb
ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]
press enter to continue
History: ["Line1"]
> Line1 # up arrow was pressed here and entry from history was shown up
```

Bug affects for example `pry` gem (history doesn't work).

**My setup**

```
macOS 11.2.1 Big Sur
architecture: arm64 (apple M1 processor)
ruby -v: ruby 3.1.0dev (2021-02-13T02:51:33Z master 813fe4c256) [arm64-darwin20]

readline extension linkage:
otool -L /Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle
/Users/radarek/opt/ruby/lib/ruby/3.1.0/arm64-darwin20/readline.bundle:
	/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
```

---Files--------------------------------
bug.rb (271 Bytes)
Dockerfile (340 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-29 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 13:29 [ruby-core:102487] [Ruby master Bug#17629] macOS, readline compiled with libedit: adding entries to history doesn't work unless Readline.readline is called before populating it radek.bulat
2021-02-14 14:56 ` [ruby-core:102488] " radek.bulat
2021-09-28 23:23 ` [ruby-core:105476] " radarek
2021-09-29  2:26 ` [ruby-core:105481] " nobu (Nobuyoshi Nakada)
2022-01-29 19:30 ` [ruby-core:107348] " radarek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).