everything related to duct tape audio suite (dtas)
 help / color / mirror / code / 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 related	[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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/dtas.git/

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