esp-idf/tools
Frantisek Hrbata 84deb34035 tools: fix progress output in asyncio.run with zero terminal width
Currently the forced progress in RunTool is trying to fit the output
line into a terminal width, but it doesn't take into an account a
situation when the terminal width is reported as zero. This manifests
when running in docker image with redirected output and can be seen
in the github workflow output for esp-idf-ci-action.

docker run --rm -t my_ubuntu_esp python3 -c 'import os,sys; print(os.get_terminal_size(), sys.stdout.isatty())'
os.terminal_size(columns=238, lines=59) True

vs

docker run --rm -t my_ubuntu_esp python3 -c 'import os,sys; print(os.get_terminal_size(), sys.stdout.isatty())' | tee
os.terminal_size(columns=0, lines=0) True

Since the output is reported as tty and the terminal width as 0, the
fit_text_in_terminal() function returns empty string. I also verified this
by running idf.py build inside a testing docker image.

This fix adjusts the fit_text_in_terminal() function to return original
line if the terminal width is zero.

Also simplify the progress print and use same approach as ninja
https://github.com/ninja-build/ninja/blob/master/src/line_printer.cc#L66

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-03-29 17:12:36 +02:00
..
ble feat: add requirements.ttfw.txt 2022-08-01 15:52:21 +08:00
catch Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
ci tools: Move out idf_size.py in favour of using the esp-idf-size package 2023-03-27 19:40:33 +02:00
cmake tools: Move out idf_size.py in favour of using the esp-idf-size package 2023-03-27 19:40:33 +02:00
docker tools: Docker: add build-essentials needed for linux targets 2023-02-28 11:27:25 +01:00
esp_app_trace sys_view: upgrade to version 3.32 2023-01-24 00:26:58 +07:00
esp_prov docs: added documentation for wifi_ctrl endpoint and updated esp_prov readme 2022-11-01 14:19:01 +05:30
gen_soc_caps_kconfig build-system: include soc_caps defines into kconfig 2021-12-06 12:37:07 +08:00
idf_py_actions tools: fix progress output in asyncio.run with zero terminal width 2023-03-29 17:12:36 +02:00
kconfig_new tools: Move out kconfig_new in favour of using the esp-idf-kconfig package 2022-11-15 21:19:51 +01:00
ldgen TWDT: Use the new TWDT Kconfig options in the examples and tests 2023-02-17 11:22:25 +08:00
mass_mfg tools: remove the dependency on the future package 2022-08-09 16:46:58 +02:00
mocks [tcp_transport] - Adds Socks4 proxy transport 2023-03-27 14:46:40 +02:00
requirements tools: Move out idf_size.py in favour of using the esp-idf-size package 2023-03-27 19:40:33 +02:00
templates/sample_component add new command to idf 2020-09-21 23:38:52 +02:00
test_apps Merge branch 'feature/unicore_bootloader_can_run_multicore_app' into 'master' 2023-03-29 21:56:26 +08:00
test_build_system tools: add target consistency checks to cmake 2023-03-08 16:45:47 +01:00
test_idf_py hints: add a more complete description for component not found errors 2022-12-06 10:54:44 +08:00
test_idf_tools ci: add dep check_python_dependencies.pyt test 2023-03-17 15:22:33 +01:00
test_mkdfu mkdfu.py: Support setting flash parameters 2022-05-27 15:44:56 +02:00
test_mkuf2 idf.py: Change copyright in tools dir 2022-05-24 14:01:50 +02:00
unit-test-app esp-system: migrate test app cases to pytest 2023-03-01 03:21:39 +00:00
check_python_dependencies.py Tools: Improve the message for missing setuptools in the Python checker 2022-07-18 11:56:32 +02:00
check_term.py check_term: allow alacritty term 2022-05-19 11:10:59 +08:00
detect_python.fish Tools: Use default value in the Python detections scripts 2022-03-11 11:00:31 +01:00
detect_python.sh Tools: Use default value in the Python detections scripts 2022-03-11 11:00:31 +01:00
eclipse-code-style.xml tools: add code formatter rules for Eclipse 2016-11-03 18:41:00 +08:00
format-minimal.sh global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs 2020-04-03 01:10:02 +02:00
format.sh global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs 2020-04-03 01:10:02 +02:00
gdb_panic_server.py tools: gdb_panic_server: add esp32h2 2023-01-04 17:00:16 +01:00
gen_esp_err_to_name.py tool: skip test folder when generating esp_err_t table 2022-11-10 10:37:59 +08:00
generate_debug_prefix_map.py build: create BUILD_DIR/prefix_map_gdbinit when enable reproducible build 2021-10-26 10:55:00 +08:00
idf_monitor.py feat(idf_monitor): move idf_monitor to separate repo 2023-02-03 11:20:15 +01:00
idf_size.py tools: Move out idf_size.py in favour of using the esp-idf-size package 2023-03-27 19:40:33 +02:00
idf_tools.py tools: add triplet i686-linux-gnu for distributions 2023-02-22 05:33:03 +00:00
idf.py Merge branch 'bugfix/ctrlc_port_detection' into 'master' 2023-01-27 16:51:26 +08:00
install_util.py Tools: --disable-* argument for removing features 2022-06-30 12:31:59 +02:00
mkdfu.py tools: remove the dependency on the future package 2022-08-09 16:46:58 +02:00
mkuf2.py Merge branch 'fix/flake8_v5_warnings' into 'master' 2022-08-12 23:27:14 +08:00
python_version_checker.py Tools: Fix silent failure about the incompatible Python 2022-02-16 18:44:13 +01:00
requirements_schema.json Tools: Make easier the detection of the list of Python features 2022-02-03 19:02:14 +01:00
requirements.json feat: add requirements.ttfw.txt 2022-08-01 15:52:21 +08:00
set-submodules-to-github.sh global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs 2020-04-03 01:10:02 +02:00
split_paths_by_spaces.py tools: fixup version references related to paths with spaces 2022-05-02 19:05:47 +02:00
tools_schema.json tools: add esp-rom-elfs version '20220823' 2022-09-21 22:39:03 +04:00
tools.json Merge branch 'feature/update_ccache_to_4.8' into 'master' 2023-03-29 22:18:16 +08:00