Using ansible when fastfetch is activate in $HOME/.bashrc (neofetch clone)

So first, ansible works fine without the following line in my $HOME/.bashrc

fastfetch

fastfetch is a tool for fetching system information and displaying it prettily in console output.
but when i added fastfetch in my $HOME/.bashrc, Some warnings are printed

# [WARNING]: Unhandled error in Python interpreter discovery for host localhost: unexpected output from Python interpreter discovery
# [WARNING]: sftp transfer mechanism failed on [localhost]. Use ANSIBLE_DEBUG=1 to see detailed information
# [WARNING]: scp transfer mechanism failed on [localhost]. Use ANSIBLE_DEBUG=1 to see detailed information
# [WARNING]: Platform unknown on host localhost is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change the meaning of that path. See
# https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.

I fix the last warning with a localhost.yml in host_vars which contains

ansible_python_interpreter: /usr/bin/python3

and then I ran ansible with debug mode

 21249 1720419704.50439: variable 'ansible_python_interpreter' from source: playbook host_vars for 'localhost'
 21249 1720419704.50465: transferring module to remote /home/dfabert/.ansible/tmp/ansible-tmp-1720419704.3633587-21249-201536959117241/AnsiballZ_discord.py
 21249 1720419704.50536: Sending initial data
 21249 1720419704.50539: Sent initial data (172 bytes)
 21249 1720419704.57028: stderr chunk (state=3):
>>>Received message too long 538976288
Ensure the remote shell produces no output for non-interactive sessions.
<<<
 21249 1720419704.57038: stdout chunk (state=3):
>>><<<
[WARNING]: sftp transfer mechanism failed on [localhost]. Use ANSIBLE_DEBUG=1 to see detailed information

Is someone already fix the others warnings ?

Thanks

I have a shortcut in my .bashrc that exits out early in case a non-interactive shell is started:

# Shortcut when running non-interactive shells
[ -z "$PS1" ] && return

Thanks a lot, it’s working like a charm.