ansible / ansible-navigator

A text-based user interface (TUI) for Ansible.
https://ansible.readthedocs.io/projects/navigator/
Apache License 2.0
391 stars 100 forks source link

ansible-navigator ignores $TERM settings #1828

Open olbohlen opened 3 months ago

olbohlen commented 3 months ago
ISSUE TYPE
SUMMARY

Running ansible-navigator from a dumb terminal (jenkins, non ttys, or emacs eshell) produces weird output

ANSIBLE-NAVIGATOR VERSION
(1139) heavy:/home/olbohlen$ ansible-navigator --version                      
ansible-navigator 24.3.2
CONFIGURATION

$ cat .ansible-navigator.yaml

ansible-navigator: color: enable: true mode: stdout editor: command: /bin/emacsclient playbook-artifact: enable: false execution-environment: image: registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest environment-variables: set: PAGER: cat pull: policy: missing logging: file: /tmp/ansible-navigator.log append: true level: debug

LOG FILE

[olbohlen@heavy scratch]$ TERM=dumb ansible-navigator run hello.yaml [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' eyJ1dWlkIjogImUwNDRjNWFmLTRjMGYtNDA4NS05NWJmLWFiMmJmYzZkYzY5YiJ9e30=eyJ1dWlkIjogIjQ2ZDIyNzRmLWIxZGEtOTJlYS1kOTE5LTAwMDAwMDAwMDAwMSJ9 PLAY [Sample Play] **** e30=eyJ1dWlkIjogIjQ2ZDIyNzRmLWIxZGEtOTJlYS1kOTE5LTAwMDAwMDAwMDAwOCJ9 TASK [Gathering Facts] e30=eyJ1dWlkIjogImQ1N2JhN2IwLTQ1YzgtNDM4NS05OWM1LWVmMWIyZjlkODM5ZCJ9e30=eyJ1dWlkIjogIjZmMjYzZTljLWI2MGMtNGU2OC1hZjg2LTZiYjczNWYyZGU1ZCJ9ok: [localhost] e30=eyJ1dWlkIjogIjQ2ZDIyNzRmLWIxZGEtOTJlYS1kOTE5LTAwMDAwMDAwMDAwMyJ9 TASK [print a hello message] * e30=eyJ1dWlkIjogIjllNWUyMmVkLWZiZTktNDJlYy04NGFiLWYyOTI5ODE4Y2IwMSJ9e30=eyJ1dWlkIjogImNhYjNiN2MzLWYxZDItNDRhMC04Njc4LTViYTNkZGNhYjhhYSJ9ok: [localhost] => { "msg": "Hello World!" } e30=eyJ1dWlkIjogIjVlNDRhMDM0LThkY2ItNDE0Yi04YWMwLTVmNDgxZmEyNjMyNSJ9 PLAY RECAP *** localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

e30=

STEPS TO REPRODUCE

Run ansible-navigator in a Terminal that does not support ANSI control characters like the emacs eshell.

EXPECTED RESULTS

Setting TERM=dumb should ensure that the command just prints clean ASCII without control-characters, as the terminal is "dumb"...

ACTUAL RESULTS

As` you can see above, you get fancy control chars in the output.

ADDITIONAL INFORMATION
olbohlen commented 3 months ago

This relates a bit to https://github.com/ansible/ansible-navigator/issues/1736