Skip to content

Commit

Permalink
More gracious terminal width discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarlesky committed Apr 19, 2024
1 parent e697a61 commit 1acb1da
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/app_cfg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,18 @@ def initialize()
# Default to `exit(1)` upon failing test cases
:tests_graceful_fail => false,

# Get terminal width in columns
:terminal_width => (IO.console.winsize)[1],
# Set terminal width (in columns) to a default
:terminal_width => 120,
}

set_paths( ceedling_root_path )

# Try to query terminal width (not always available on all platforms)
begin
@app_cfg[:terminal_width] = (IO.console.winsize)[1]
rescue
# Do nothing; allow default value already set to stand
end
end

def set_project_config(config)
Expand Down

0 comments on commit 1acb1da

Please sign in to comment.