Skip to content

Commit

Permalink
Update for Term::Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
docelic committed Apr 21, 2022
1 parent f21fc57 commit ab72cab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tput
version: 1.0.3
version: 1.0.4

authors:
- Davor Ocelic <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion src/tput.cr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require "./tput/emulator"
# In all of the examples above, spaces exist just for clarity and are not part of actual escape
# sequences. For example, in "ESC [" or " Ps ; Ps ;" there are no actual spaces.
class Tput
VERSION = "1.0.3"
VERSION = "1.0.4"
include Namespace
include JSON::Serializable
include Crystallabs::Helpers::Logging
Expand Down
4 changes: 3 additions & 1 deletion src/tput/coordinates.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ class Tput
# Gets terminal/screen size as number of columns and rows.
def get_screen_size
r, c = ENV["TPUT_SCREEN_SIZE"]?.try { |s| s.split('x', 2).map &.to_i } ||
Term::Screen.size_from_ioctl ||
Term::Screen.size_from_ioctl(STDIN) ||
Term::Screen.size_from_ioctl(STDOUT) ||
Term::Screen.size_from_ioctl(STDERR) ||
Term::Screen.size_from_env ||
Term::Screen.size_from_ansicon ||
{DEFAULT_SCREEN_SIZE.height, DEFAULT_SCREEN_SIZE.width}
Expand Down

0 comments on commit ab72cab

Please sign in to comment.