F3 to F10 not working with TERM=ansi ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users F3 to F10 not working with TERM=ansi ?
# 1  
Old 03-04-2007
F3 to F10 not working with TERM=ansi ?

Hello friends,

I am using SCO Openserver 5.0.7. At the server console, the function keys F3-F10 do not work with my Sybase 4.2 application when I set the TERM environment variable to 'ansi'. What changes should I do to the terminfo source of 'ansi' to enable the function keys?
An early response would be highly appreciated.

Regards

Sabu.
# 2  
Old 03-04-2007
Quote:
Originally Posted by sabu
Hello friends,

I am using SCO Openserver 5.0.7. At the server console, the function keys F3-F10 do not work with my Sybase 4.2 application when I set the TERM environment variable to 'ansi'. What changes should I do to the terminfo source of 'ansi' to enable the function keys?
An early response would be highly appreciated.

Regards

Sabu.
You shouldn't do anything to the terminfo source for an ansi terminal.

You should make sure your TERM environment variable is set to the proper value. A value which matches with the capabilities of your terminal.

If you really want to change the info for an ansi terminal you can use either "untic" or "infocmp" (depending on the type of Unix you are running) to get the current information for an ansi terminal.

This info you redirect to a file.

You add the necessary information to this file.

With "tic" you can store the new definition in the terminfo database.

See the "terminfo" manual page for which capabilities can be defined.
For function keys they are kf0, kf1, kf2, ............

To know the values to define for this keys one has to know the terminal type you are actually using.
# 3  
Old 03-05-2007
Thanks for the response. I have another TERM setting, 'gist', that works fine with the function keys but the graphic characters do not display correctly. The display in the 'ansi' mode is correct but the function keys F3-F10 do not work. Can I copy the function key settings in 'gist' into the 'ansi' source and recompile with 'tic'?
# 4  
Old 03-05-2007
my os is SCO 5.0.6
and my TERM=scoansi and it work proper.
and you can also copy some of gist line in ansi , or ansi line in gist or
you can use vt100 term type.
pankaj
# 5  
Old 03-05-2007
y
Quote:
Originally Posted by sabu
Thanks for the response. I have another TERM setting, 'gist', that works fine with the function keys but the graphic characters do not display correctly. The display in the 'ansi' mode is correct but the function keys F3-F10 do not work. Can I copy the function key settings in 'gist' into the 'ansi' source and recompile with 'tic'?
It is better to leave the ansi definition as it is and create your own terminal definition

"infocmp ansi"

will produce output which looks like something like this:

Code:
ansi|generic ansi standard terminal,
        am, xon,
        cols#80, lines#24,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
        clear=\E[H\E[J, cr=\r, cub=\E[%p1%dD, cub1=\b,
        cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
        home=\E[H, hpa=\E[%p1%{1}%+%dG, ht=\t, hts=\EH,
        ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L,
        ind=\n, invis=\E[8m, kbs=\b, kcub1=\E[D, kcud1=\E[B,
        kcuf1=\E[C, kcuu1=\E[A, khome=\E[H,
        rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rmso=\E[m,
        rmul=\E[m,
        sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m,
        sgr0=\E[0m, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
        vpa=\E[%p1%{1}%+%dd,

Copy this into a file and change the first line
E.g.

myansi|my ansi terminal,

and the function key definitions
kf0=...., kf1=......, kf2=.......

and you get something like this:

Code:
myansi|my ansi terminal,
        am, xon,
        cols#80, lines#24,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
        clear=\E[H\E[J, cr=\r, cub=\E[%p1%dD, cub1=\b,
        cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
        home=\E[H, hpa=\E[%p1%{1}%+%dG, ht=\t, hts=\EH,
        ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L,
        ind=\n, invis=\E[8m, kbs=\b, kcub1=\E[D, kcud1=\E[B,
        kcuf1=\E[C, kcuu1=\E[A, khome=\E[H,
        rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rmso=\E[m,
        rmul=\E[m,
        sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m,
        sgr0=\E[0m, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
        vpa=\E[%p1%{1}%+%dd,
        kf0=...., kf1=......, kf2=.......


so:

Code:
infocmp ansi > file          (or untic ansi > file)
vi file                            (make changes as mentioned above)
tic file

to get the pf1, pf2, pf3, definitions:

infocmp gist > file2 (or untic gist > file2)

After that you set your TERM variable to "myansi"

This might work if none of they keys conflict. Always hard to define a terminal by its capabalities.

Before you try all of this you might wanna try TERM=vt220

Last edited by sb008; 03-05-2007 at 05:23 PM..
# 6  
Old 03-10-2007
Thanks SB008 & Pankaj Braval for your valuable suggestions. I'll try it out and let you know.

Regards

Sabu
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

why the implementatoin of Bakery algorithm in ANSI C does not work in ANSI C

I follow the description of wiki (Lamport's bakery algorithm - Wikipedia, the free encyclopedia), then implement that algorithm in C, but it doesn't work, Starving is still here, is the implementation worry? Only print out: Thread ID: 0 START! Thread ID: 0 END! Thread ID: 0 START!... (2 Replies)
Discussion started by: sehang
2 Replies

2. HP-UX

HP-UX ansi c precompiler

Hi, How can i find which ansi c precompiler are installed on my hp-ux b11.23 itanuim machine ? Thanks (3 Replies)
Discussion started by: yoavbe
3 Replies

3. HP-UX

Unix_ANSI to PC-ANSI

I want to convert a file from Unix-ANSI to PC-ANSI format. How can i achieve that? (0 Replies)
Discussion started by: ssmallya
0 Replies

4. Shell Programming and Scripting

Convert file from Unix - ANSI to PC - ANSI

Hi, I am creating a file in Unix using a shell script. The file is getting created in the Unix - ANSI format. My requirement is to convert it to the PC - ANSI format. Can anyone tell me how to do this? Thanks, Sunil (0 Replies)
Discussion started by: ssmallya
0 Replies

5. Shell Programming and Scripting

Search term and output term in desired field

Hi All, I have an input_file below and i would like to use Perl to search for the term "aaa" and output the 3rd term in the same row as "aaa".For Example, i want to search for the term "ddd" and would want the code to ouput the 3rd term in the same row which is "fff". Can somebody help ? ... (28 Replies)
Discussion started by: Raynon
28 Replies

6. Programming

hint on ansi c

I am a student. And need help on following program. I want to make a c program. I have to scan a sentence and I have to interchange a word from that sentence. Example: Scan the sentence is " Drilling machine and Milling machine " . Replace the word "machine" by "operation". And output should... (2 Replies)
Discussion started by: dhaval chevli
2 Replies

7. Programming

Create a Term & Run chars on this Term

hi floks ! i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term. I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to... (1 Reply)
Discussion started by: the_tical
1 Replies

8. Programming

ANSI C vs POSIX

can somebody explain about the ANSI C vs POSIX. say i was using open and fopen, i know that open is POSIX, and fopen is ANSI C. i read that that POSIX is a system call and ANSI C is like a standard library function. wouldn't the fopen function has to call on open function anyway to open any kind... (2 Replies)
Discussion started by: bb00y
2 Replies

9. Programming

Ansi C

Dear All, I have to develope some C functions in Unix for a Magic program. The original MSE code which compiles the attached C program uses a +z option, but the cc compiler don't know this. The complete command in the compiler script is 'cc -c -Aa +z myfile.c'. The warning message is 'The -z... (4 Replies)
Discussion started by: Frankie
4 Replies
Login or Register to Ask a Question