#!/bin/sh
##############################################################################
-# Copyright (c) 2004,2011 Free Software Foundation, Inc. #
+# Copyright (c) 2004-2011,2012 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
#
# Author: Thomas E. Dickey
#
-# $Id: gen_edit.sh,v 1.2 2011/09/11 00:47:26 tom Exp $
+# $Id: gen_edit.sh,v 1.4 2012/02/11 16:30:03 tom Exp $
# Generate a sed-script for converting the terminfo.src to the form which will
# be installed.
#
# The leaf directory names (lib, tabset, terminfo)
#
-: ${ticdir=@TERMINFO@}
+: ${datadir=@datadir@}
: ${xterm_new=@WHICH_XTERM@}
+: ${xterm_kbs=@XTERM_KBS@}
# If we're not installing into /usr/share/, we'll have to adjust the location
# of the tabset files in terminfo.src (which are in a parallel directory).
-TABSET=`echo $ticdir | sed -e 's%/terminfo$%/tabset%'`
+TABSET=${datadir}/tabset
if test "x$TABSET" != "x/usr/share/tabset" ; then
cat <<EOF
s%/usr/share/tabset%$TABSET%g
EOF
fi
+if test "$xterm_kbs" != "BS" ; then
+cat <<EOF
+/^xterm+kbs|fragment for backspace key/,/^#/{
+ s/kbs=^H,/kbs=^?,/
+}
+EOF
+fi
+
# Work around incompatibities built into Linux console. The 2.6 series added
# a patch to fixup the SI/SO behavior, which is closer to vt100, but the older
# kernels do not recognize those controls.