The existing code sometimes fails to set $TERM. For example, when the selected profile on disk contains this line : Environment=FOO=BAR Konsole fails to set $TERM