Skip to content

Commit

Permalink
Get wrap width from terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
pabzm committed Dec 10, 2024
1 parent 809c1ee commit a100606
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/test-remote-access.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

define('COL_WIDTH', intval(trim(exec('tput cols 2>/dev/null'))) ?: 80);

function say($msg)
{
echo wordwrap("{$msg}\n");
echo wordwrap("{$msg}\n", constant('COL_WIDTH'));
}

function error($msg, $exitcode = 1)
Expand Down

0 comments on commit a100606

Please sign in to comment.