lib/console/terminal/xterm.rb in console-1.24.0 vs lib/console/terminal/xterm.rb in console-1.25.0
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
# Released under the MIT License.
-# Copyright, 2019-2023, by Samuel Williams.
+# Copyright, 2019-2024, by Samuel Williams.
require 'io/console'
require_relative 'text'
@@ -39,9 +39,16 @@
true
end
def size
@output.winsize
+ rescue Errno::ENOTTY
+ # Fake it...
+ [24, 80]
+ end
+
+ def width
+ size.last
end
def style(foreground, background = nil, *attributes)
tokens = []