Skip to content

Commit

Permalink
Change size from ansicon to allocate window dimensions without fewer …
Browse files Browse the repository at this point in the history
…objects
  • Loading branch information
piotrmurach committed Dec 15, 2023
1 parent b4f22c3 commit 22ace3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Change size detection from the environment variables to use the env method
* Change size from the ansicon environment variable to use the env method
* Change size from ansicon to use regexp last match to lookup pattern matches
* Change size from ansicon to allocate window dimensions with fewer objects

### Fixed
* Fix ioctl call test to stub terminal size encoding for big-endian systems
Expand Down
2 changes: 1 addition & 1 deletion lib/tty/screen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def size_from_env
def size_from_ansicon
return unless env["ANSICON"] =~ /\((.*)x(.*)\)/

size = [::Regexp.last_match(2), ::Regexp.last_match(1)].map(&:to_i)
size = [::Regexp.last_match(2).to_i, ::Regexp.last_match(1).to_i]
size if nonzero_column?(size[1])
end
module_function :size_from_ansicon
Expand Down

0 comments on commit 22ace3b

Please sign in to comment.