Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Unix Operating Systems Software

Properly Configuring Terminal Emulation in Unix? 20

Jobe_br asks: "I've recently come across a need for a way of connecting to a SCO Unix box with full SCO-ANSI emulation (so that I can send F1-F12 commands and ASCII line art appears as lines, not strange foreign letters). After checking out the Terminal-HOWTO at linuxdoc.org I came away with no clearer understanding of what I need to do. I can pretty much pick any 'ole terminal emulator for win32 and get what I need, but no matter what I do to fiddle with my xterms/eterms/vts I can't get things to go. Is this not facilitated under Linux?"
This discussion has been archived. No new comments can be posted.

Properly Configuring Terminal Emulation in Unix?

Comments Filter:
  • by wang33 ( 531044 )
    We had this problem too at work, our solution run CRT [vandyke.com] in wine. It was a pain to configure but works really well now after some trouble shooting. Found one other package that claims to do what you want out of the box but couldn't even get the software to run for me, it was from Pericom-Software.com [pericom-software.com]. Crappy install and just all around seems like pretty poor software but your mileage may vary.
    • our solution run CRT

      I'm running SCRT under windoze to access my linux Firewall. I had to edit the keymap to have it work correctly with the F1-F10 keys. But I'm still having problem with many keys. Can you help me with this?
      I'm using mc to browse-edit-start. I still can't use CTRL+ENTER to copy the file name in the command line. CTRL-PGUP, CTRL-PGDN, KeyPad+, KeyPad-, are keys impossible to pass correctly.

      A more broader question. Does anyone know what is the syntax used to pass all these control keys from the terminal to the server? CTRL keys, ALT keys... Is there a prefix code? one code for the control key + one code for the key, ESC-encoded or not?

  • I used to use a program called ansiterm on the SGIs at school that had pretty good ANSI support (though I don't know what differences between Sco-ANSI and "regular" ANSI are.) I'm pretty sure I had a version running under slackware about 5 years ago, but when I search for it now all I find are links to an Apple IIgs program of the same name. Does anyone else out there remember this beast?
  • You might try this (Score:4, Informative)

    by xiox ( 66483 ) on Monday October 29, 2001 @03:52PM (#2493999)
    Found this [aljex.com] on google.
    • by ksheff ( 2406 )

      After getting the correct termcap entries, to make xterm have the correct function key mappings, you can put the following in your ~/.Xdefaults file if you are going to use the scoansi terminal type:

      SCOTerm.vt100.translations:#override\

      <Key>F1: string(0x1b) string("[M")\n\
      <Key>F2: string(0x1b) string("[N")\n\
      <Key>F3: string(0x1b) string("[O")\n\
      <Key>F4: string(0x1b) string("[P")\n\
      <Key>F5: string(0x1b) string("[Q")\n\
      <Key>F6: string(0x1b) string("[R")\n\
      <Key>F7: string(0x1b) string("[S")\n\
      <Key>F8: string(0x1b) string("[T")\n\
      <Key>F9: string(0x1b) string("[U")\n\
      <Key>F10: string(0x1b) string("[V")\n

      When you run an xterm that you want to have those keybindings, just run it as xterm -name SCOTerm. If you need to send different function key sequences, look at the /etc/termcap or the terminfo stuff to determine what the function keys are to send.

      • I don't quite understand.

        How do I 'use the scoansi terminal type'?

        From what I was able to figure out from previous posts, I can copy termcap files from linux->SCO so that SCO recognizes my linux console - at that point, I'd be using a 'linux' or 'linux-console' terminal type, right?

        Any insights, please send to my email.

        • From what I was able to figure out from previous posts, I can copy termcap files from linux->SCO so that SCO recognizes my linux console - at that point, I'd be using a 'linux' or 'linux-console' terminal type, right?

          From what I understand, it would describe to the programs that use the termcap/terminfo the capabilities of the terminal being used. Some of this included the byte sequences to make the terminal do a particular function, other parts include what byte sequences the terminal sends when the user presses a special key or some other operation. If you were to copy the section of the termcap file with the linux console to your SCO machine, the programs on the SCO machine should be able to 'do the right thing' when you are logging into the SCO machine from the linux console.

          This doesn't help you if you intend on using xterm. According to the manual page:

          Termcap(5) entries that work with xterm include ``xterm,'' ``vt102,'' ``vt100'' and ``ansi,'' and xterm automatically searches the termcap file in this order for these entries and then sets the ``TERM'' and the ``TERMCAP'' environment variables.
          If you have a terminal definition that is like vt100/ansi, but has extra or different definitions for terminal function keys, then you can force the setting of the TERM variable to the terminal definition that you want to use and then use the ~/.Xdefaults settings to force xterm to send different byte sequences for the function keys. However, one can't just pick any old terminal definition and expect it to work if it is very different from the actual terminal. It would be like hanging a sign that says "Ich spreche den Deutsch"(from babelfish) on someone that doesn't speak German and expect them to carry on a conversation in German.

          Most Windows terminal programs emulate ansi/vt100/vt102 and allow one to edit the key mappings. If you can get something like this to work from Windows, then you should be able to configure xterm to use the same byte sequences for the function keys.

  • most unixes maintain a terminal database file usually in /etc/terminfo or something similar in /etc. if you add the linux terminal database to your SCO box your should be able to handle the SCO box like a linux box.
    • Re:/etc/terminfo (Score:1, Insightful)

      by Anonymous Coward
      In a perfect world, this would work well:

      Unfortunately, I use an app on SCO that has it's own termcap database, and the app itself is written for use only by the ANSIC terminal type (color, F keys, etc...). Since the app uses it's own termcap DB, and it is written specifically for the ANSIC terminal type...

      Poor design, yes, but that's the way it was written. Which means I need to figure out a way to get linux to speak SCOANSI/ANSIC - an ideas?
      • *shrug* move the SCO termcap over to the linux box. than your linux box will act exactly like a SCO box...alternatively you can append it on your linux box and then do a setenv TERM=ANSIC and ssh into the SCO box.

        • No, the termcap and TERM variable describe a terminal; they don't control it. Changing the TERM variable will not have any effect on what xterm sends when you hit (for example) F1, nor will it make xterm understand whatever fancy line-drawing characters the SCO box sends to it.
  • I have been trying to get full (i.e., all F-keys, escape and backspace/delete etc) terminal emulation going on a DOS machine connected to a linux machine over a serial cable. I can specify what terminal type that the getty should use on that line in /etc/inittab.

    On the DOS machine I am using kermit. There is a vt300.ini file which puts it into vt300 emulation mode. Except that if I connect to the linux machine, I have to do "set term type ansi-bbs" to be able to see any text, and if I start up midnight commander not all of the F-keys work.

    I looked the various "set key" commands in the vt300.ini file, and I had the hope that I could look at the termcap definition of vt300 (actually vt320) on the linux machine and somehow figure out how to set the F-keys to send the right thing.

    But no luck so far. How do you figure out exactly what mc is expecting for a certain key ? Isn't this somehow in the ncurses library related stuff ? Should I try a different terminal type -- perhaps midnight commander wouldn't work correctly even if I had a real hardware vt320 ?

    In general, how do you debug stuff like this ? Is there a program in the ncurses package, or that uses it, that I can run, press a key, and it will show me what the terminal emulator should send (in terms of what binary combination) to emulate that key ? Then I could generate the key-to-binary mapping by hand, and then use that to generate a file of "set key" commands to configure kermit correctly. If I was trying to emulate something with more F-keys than my keyboard, I could look into using shift-Fkey to emulate the higher ones, or whatever. But I would at least know what I needed to send, and that's the part I'm having trouble figuring out.

    By the way, the /etc/termcap file has some interesting reading in the comments. Check it out next time you are waiting for a compile to finish.
    • Kermit doesn't do terminal emulation :( - at least this is what I've found in my quest so far.
      • Sure it does. It does a lot more, but it definitely does that. Look at the What is Kermit [columbia.edu] page and do a page search on "terminal emulation."

        A "terminal" is a keyboard and monitor (or in the old days, a teletype machine (that's where "tty" comes from), basically a keyboard and line printer) with a wire connection to a host computer. For each such piece of hardware built, there was a protocol for how the host computer could tell the screen what to display and what bytes would be sent with each keystroke. (Actually some terminals allowed you edit an entire line and then send it at once.)

        When I take one computer and hook it to another with a piece of wire, the software that causes the first computer to send exactly the same things to make it look like the terminal hardware is on the other end is naturally enough called a "terminal emulator."

        You can take an old PDP11, disconnect it's vt220 or vt100 terminal, hook up the wire to a computer instead, run kermit connected to that port, tell kermit to pretend to be a vt100 or vt220 or whatever, and the PDP11 should not be able to figure out that there isn't a real hardware terminal on the other end.

        These days you don't have to have a separate hardware port for each terminal, you can connect many at once via Linux's virtual terminals or networks or whatever.

  • I had a similar problem with AIX. If you do a CTRL^Left-Click (of an xterm), you will see the option 'Old Function-Keys'. --try it

    If it works, then add this line to your ~/.Xdefaults file:


    XTerm*oldXtermFKeys: true

On the eighth day, God created FORTRAN.

Working...