diff --git a/src/future/exec/CommandException.php b/src/future/exec/CommandException.php --- a/src/future/exec/CommandException.php +++ b/src/future/exec/CommandException.php @@ -61,9 +61,11 @@ $len = strlen($string); if ($len > $limit) { $cut = $len - $limit; - $suffix = pht('... (%s more byte(s)) ...', new PhutilNumber($cut)); - if ($cut > strlen($suffix)) { - $string = substr($string, 0, $limit).$suffix; + $middle = pht('... (%s more byte(s)) ...', new PhutilNumber($cut)); + if ($cut > strlen($middle)) { + $start = substr($string, 0, $limit * 2 / 3); + $end = substr($string, $len - $limit / 3); + $string = $start.$middle.$end; } }