I have put export TERM=xterm-24bits in my .bashrc but it seems Upterm is overriding the value. Emacs doesn't work without this specific value.
On a side note: Even when I set this variable explicitly in the running shell, the results are not not optimal at all: