summaryrefslogtreecommitdiff
path: root/lib/error_highlight/formatter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/error_highlight/formatter.rb')
-rw-r--r--lib/error_highlight/formatter.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/error_highlight/formatter.rb b/lib/error_highlight/formatter.rb
index ba0093d3e5..d2fad9e75c 100644
--- a/lib/error_highlight/formatter.rb
+++ b/lib/error_highlight/formatter.rb
@@ -56,11 +56,11 @@ module ErrorHighlight
end
def self.terminal_width
- # lazy load io/console, so it's not loaded when 'max_snippet_width' is set
+ # lazy load io/console to avoid loading it when 'max_snippet_width' is manually set
require "io/console"
- STDERR.winsize[1] if STDERR.tty?
+ $stderr.winsize[1] if $stderr.tty?
rescue LoadError, NoMethodError, SystemCallError
- # do not truncate when window size is not available
+ # skip truncation when terminal window size is unavailable
end
end