fp Termcap issue
Brian K. White
brian at aljex.com
Thu May 28 16:20:03 PDT 2009
Douglas Luurs wrote:
>
> We’re migrating FilePro from SCO Openserver 6.0 to RedHat Enterprise
> Linux 5.3. We’re trying to get all of our key bindings to match the
> old installation by changing /appl/fp/termcap. We’re having good
> success except when changing the BRKY key. On the old server BRKY was
> assigned to Delete whereas on the new server it’s assigned to Ctrl-C.
> Within the FilePro developers reference (page 658) I can see that the
> termcap code for BRKY is PY. Trouble is, no matter what I set PY to,
> the setting isn’t honored. I’m able to get our other bindings
> changed, just not this one.
>
>
>
> Any input you have would be appreciated as this has become a
> frustrating problem.
>
I would use a linux terminal emulator and ctrl-c for break instead of
continuing to use scoansi emulation.
To use scoansi emulation you will have to do several things, and, at the
console it still won't work and you'll have to use linux or xterm, but
scoansi terminal emulators can be made to work.
copy the "ansi" termcap entry from /etc/termcap on sco.
add it to the beginning on /etc/termcap on linux, and rename it from
ansi to scoansi.
search the rest of the file to be sure there isn't by chance a scoansi
provided by redhat. (there will be an "ansi" , leave it alone. don't
rename or remove it)
infocmp >scoansi.ti on sco
vi scoansi.ti and change the name of the entry from ansi to scoansi
install ncurses-devel on linux to get the tic utility
tic scoansi.ti on linux
create /etc/profile.local , or edit if it already exists
(verify that /etc/profile will look for profile.local and source it if
it exists)
in /etc/profile.local:
case "$TERM" in
ansi|scoansi)
TERM=scoansi
stty intr '^?'
;;
esac
edit fp/termcap and make sure the old "ansi" entry also has an alias for
scoansi
The idea is, sco terminal emulators will all generally set TERM=ansi ,
but on linux there already is a termcap & terminfo definition named
"ansi" which ideally you should not remove or overwrite with sco's
because that ansi definition is used as a sub-component of some other
definitions.
Instead, leave the existing ansi entries alone and install sco's ansi
definitions copied from you real sco box, but rename them from ansi or
cansi to scoansi along the way.
Then have /etc/profile detect if $TERM is "ansi", that will only be from
your sco terminal emulators, so any time someone logs in and their
emulator sets TERM=ansi, have /etc/profile change TERM to scoansi so
that all programs will end up using the scoansi termcap and terminfo
definitions you just installed.
Also, in that case, run an stty command to setthe break key to ^? which
is what scoansi emulators send from the Del key.
It can be a plain quote-carrot-question-quote in the stty command, you
don't have to press ctrl-v ctrl-? to get a real ^? (character 127
decimal) in there.
The PY thing in fp/termcap is just for display, it could say anything.
To rename a termcap or terminfo definition just means to change what the
first line has from the beginning of the line to the first field
seperator (colon for termcap, comma for terminfo).
Alias names in termcap & terminfo just means the same definition can
have more than one name. All names are on the first non-comment line of
the definition, before the first field seperator, and within that first
field, there is either a single name, or multiple names seperated by | .
After doing all that, The console still won't work except as a linux
terminal with linux emulation and linux keystrokes. Same goes for xterms
in the gui console.
And some programs still don't work correctly. Most notably, ls colors
are active by default and they screw up your terminal so the text ends
up dark blue on black, and vi colors are active by default and it ends
up being dark red on black. And there are background color fill issues
on some emulators where chunks of the screen fill with black instead of
the current background color blue or cyan etc, it looks ugly.
You can force both ls & vi not to use colors at all but frankly that's
retarded. Not because ls colors are so great, just because it's
addressing one symptom, and doing so in a crude way by just killing a
feature instead of making it work, and avoiding addressing the real
problem which would clear up all symptoms at once without shutting off
every feature that was invented after 1982. There are several other
small but annoying and unprofessional looking issues from apps not
handling the terminal perfectly even if you do disable colors in ls and
vi, and from your PS1 prompt which the latest linux distros like to
colorize, etc.. The problem is basically that linux apps just aren't
being written and tested to work on terminals other than linux and xterm
(which are both vt100/vt220 derivatives and share many of the same
escape sequences and behaviors). In any unix-like world, you are
_supposed_ to be able to define any kind of terminal you want via
termcap & terminfo, and all apps should just work perfectly as long as
your definitions do accurately describe your terminal. But in fact,
linux does not adhere to that ideal very well and you do yourself the
greatest favor by simply using the terminal that all those apps are
tested against. ie, linux or xetrm. Which means using ctrl-c for break,
because a linux or xterm terminal emits a multi-byte escape sequence
from the Delete key, not the single-byte ^? that scoansi terminals do,
and the break key is a tty line discipline setting that must be a single
byte.
Even though I have been forced by my boss to make scoansi emulation work
as well as possible on all our linux boxes since we switched to linux
several years ago, and all customers and all developlers except me still
use scoansi terminal emulation, I still say take Bill's advice and just
treat the terminal emulation as one more part of switching to linux.
--
bkw
More information about the Filepro-list
mailing list