everything related to duct tape audio suite (dtas)
 help / color / mirror / Atom feed
* [PATCH] dtas-console: quiet curses warnings from Ruby 2.7
@ 2019-12-19 18:25 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2019-12-19 18:25 UTC (permalink / raw)
  To: dtas-all

The "curses" gem has yet-to-be updated for rb_safe_level
deprecation in Ruby 2.7, and spewing to the terminal is
extremely annoying to users who should NOT have to know
anything about Ruby, curses, or safe levels.
---
 bin/dtas-console | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/bin/dtas-console b/bin/dtas-console
index 2143e65..07bb561 100755
--- a/bin/dtas-console
+++ b/bin/dtas-console
@@ -12,6 +12,7 @@
 require 'dtas/format'
 include DTAS::Process
 require 'yaml'
+$olderr = $stderr
 begin
   require 'curses'
 rescue LoadError
@@ -125,8 +126,24 @@ def may_fail(res, events)
   Curses.cbreak
   Curses.noecho
   screen = Curses.stdscr
+  def screen.maxx
+    $stderr = DTAS.null
+    super
+  ensure
+    $stderr = $olderr
+  end
+
+  def screen.maxy
+    $stderr = DTAS.null
+    super
+  ensure
+    $stderr = $olderr
+  end
+
+  $stderr = DTAS.null
   screen.scrollok(true)
   screen.keypad(true)
+  $stderr = $olderr
   loop do
     lineno = -1
     pfmt = cur['format']


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-19 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 18:25 [PATCH] dtas-console: quiet curses warnings from Ruby 2.7 Eric Wong

everything related to duct tape audio suite (dtas)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://80x24.org/dtas-all
	git clone --mirror http://ou63pmih66umazou.onion/dtas-all

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 dtas-all dtas-all/ https://80x24.org/dtas-all \
		dtas-all@nongnu.org
	public-inbox-index dtas-all

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.dtas
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.dtas
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	dtas.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git