Conflicting TERM env var with SetEnv feature.

Jochen Bern Jochen.Bern at binect.de
Fri Nov 23 23:41:57 AEDT 2018


On 11/23/2018 08:15 AM, Gert Doering wrote:
> Stuff like TERM=screen can be substituted reasonably well with TERM=xterm,
> for example.  (I regularily run into this when ssh'ing to AIX boxes, which
> do not know about "screen" - and since these are not mine, fixing all their
> termcap/terminfo DBs is not trivially done).

If the problem is *that* systematic, wouldn't it be a better approach to
distribute something along the lines of



# Belt&suspenders in case we get executed from a *non*-interactive shell
if [ "$TERM" != "" -a "$TERM" != "dumb" ]; then
	# Doublecheck that the termcap *still* hasn't been updated
	tput init >/dev/null 2>&1
	EXIT=$?
	if [ $EXIT -ne 0 ]; then
		# Non-understood $TERM. Try to switch to a working one.
		# (*This* machine's "working ones" are hardcoded here!)
		case $TERM in
			screen)	export TERM="xterm" ;;
			# ... more ...
			*)	export TERM="dumb" ;;
		esac
	fi
fi



into the target accounts'/machines' ~/.bash_profile's, /etc/profile's,
/etc/profile.d/TERMfix.sh's, or what-have-you's?

Regards,
-- 
Jochen Bern
Systemingenieur

www.binect.de
www.facebook.de/binect

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4278 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20181123/92f2f2ef/attachment.p7s>


More information about the openssh-unix-dev mailing list