[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15
[#85364] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults — Eric Wong <normalperson@...> 2018/02/03

v.ondruch@tiscali.cz wrote:

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:84813] [Ruby trunk Feature#13604] Exposing alternative interface of readline

From: wolf@...
Date: 2018-01-10 14:17:32 UTC
List: ruby-core #84813
Issue #13604 has been updated by graywolf (Gray Wolf).


any update on this?

----------------------------------------
Feature #13604: Exposing alternative interface of readline
https://bugs.ruby-lang.org/issues/13604#change-69527

* Author: graywolf (Gray Wolf)
* Status: Assigned
* Priority: Normal
* Assignee: kouji (Kouji Takao)
* Target version: 
----------------------------------------
GNU Readline has multiple modes of operation. At the moment, the readline extension only supports typical, `Readline.readline` mode. However, there is also alternative callback-based interface which is also useful.

```ruby
require_relative 'readline'

PROMPT = "rltest$ "

$running = true
$sigwinch_received = false

Readline.handler_install(PROMPT, add_hist: true) do |line|
	# Can use ^D (stty eof) or `exit' to exit.
	if !line || line == "exit"
		puts unless line
		puts "exit"
		Readline.handler_remove
		$running = false
	else
		puts "input line: #{line}"
	end
end

Signal.trap('SIGWINCH') { $sigwinch_received = true }

while $running do
	rs = IO.select([$stdin])
	if $sigwinch_received
		Readline.resize_terminal
		$sigwinch_received = false
	end
	Readline.read_char if r = rs[0]
end

puts "rltest: Event loop has exited"

```

Patch adding support for this is attached. This is my first try at contributing to ruby, so please tell me what I did wrong (I'm sure something, C is not my strong language).

---Files--------------------------------
readline_alternative_interface.diff (7.22 KB)
readline_alternative_interface_example.rb (606 Bytes)
readline_alternative_interface_update1.diff (7.08 KB)


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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next