В настоящее время я пытаюсь добавить индикатор выполнения в командную строку script, и я пробовал различные решения (включая Zend и Console_ProgressBar). Проблема, с которой они оба имеют общее, состоит в том, что индикатор выполнения не вставлен в нижней части окна, потому что во время script выводятся новые строки и другая информация.
Есть ли способ сохранить индикатор выполнения в нижней части терминала, но все еще иметь возможность выводить другую информацию во время работы script?
[изменить]
Я понял:
Вместо прямого вывода на STDOUT я фактически захватываю вывод внутри переменной, я стираю экран с помощью echo chr(27) . '[2J'
, а затем вывожу в STDOUT содержимое переменной, а затем добавляю мой индикатор выполнения.
Надеюсь, что это имеет смысл:)