Database Forum / Informix Topics / December 2007
dbaccess - return key does not work?
|
|
Thread rating:  |
Andrew2006 - 27 Dec 2007 11:24 GMT Hi there,
Can anyone recommend a tutorial for using dbaccess in menu mode?
When prompted to hit return, e.g. "Select a server with the Arrow Keys, or enter a name, then press Return." I can move the cursor to highlight the database but hitting return causes the cursor to move forward to the next db. Manually entering the name and hitting return will work though.
I am running it from a console in Ubuntu Linux.
Apologies if this has been asked before, but I couldn't find it by searching the group.
Kind Regards
Andrew
Art S. Kagel - 27 Dec 2007 11:52 GMT > Hi there, > > Can anyone recommend a tutorial for using dbaccess in menu mode? How about the Dbaccess Manual which is part of the IDS documentation set online.
Art S. Kagel Oninit
> When prompted to hit return, e.g. "Select a server with the Arrow > Keys, or enter a name, then press Return." I can move the cursor to [quoted text clipped - 10 lines] > > Andrew Andrew2006 - 27 Dec 2007 13:21 GMT > > Hi there, > [quoted text clipped - 20 lines] > > > Andrew Hi Art,
Have had a look at the manual, but it just reiterates what the dbaccess program tells you to do. ie. press RETURN.
Everything works for me except pressing RETURN (or Enter) :(
Thanks
Andrew
Andrew2006 - 27 Dec 2007 13:45 GMT > > > Hi there, > [quoted text clipped - 31 lines] > > Andrew The page I'm referring to is here: http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.s qlt.doc/sqlt65.htm
Jack Parker - 27 Dec 2007 14:08 GMT Let's try that again. dbaccess is not a mouse driven application. You can highlight the words on the screen all day long, but that action does not communicate with the application. Use the arrow keys to highlight databases and the return key to select them. Or type in the database you want to select on the line where it allows you to.
Use the mouse ONLY to navigate to a different window, to select text for cutting and pasting.
j.
-----Original Message----- From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org]On Behalf Of Andrew2006 Sent: Thursday, December 27, 2007 8:46 AM To: informix-list@iiug.org Subject: Re: dbaccess - return key does not work?
> On Dec 27, 11:52 am, "Art S. Kagel" <art.ka...@gmail.com> wrote: > [quoted text clipped - 35 lines] > > Andrew The page I'm referring to is here: http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.i bm.sqlt.doc/sqlt65.htm _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
Andrew2006 - 27 Dec 2007 14:34 GMT > Let's try that again. dbaccess is not a mouse driven application. You can > highlight the words on the screen all day long, but that action does not [quoted text clipped - 60 lines] > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list Hi Jack,
I'm not using the mouse to highlight words. I'm only using the keyboard here.
BTW - one reader emailed me re: TERMCAP. TERMCAP is set correctly to / opt/informix/etc/termcap. The termcap file is 1553 lines long, and I assume it's correct.
Thanks
Andrew
Jack Parker - 27 Dec 2007 15:06 GMT Somehow I got the, now obviously incorrect, impression that you were using the mouse. Apologies.
If in fact the arrow keys do not work, then TERM/TERMCAP is the likeliest issue. Sounds like you have TERMCAP set correctly, check TERM. That should match your terminal type. If you are telnetting in from a PC, then "ansi" is the proper choice. If going in through an X-Window, try "vt100" or "wyse-50". Termcap did not have a decent entry for x-term last time I checked.
( for example: export TERM=ansi )
The ctrl-xxx sequences should also work if your TERM setting is appropriate, CTRL-M is return, and then of course H, J, K, L for left, down, up and right.
j.
-----Original Message----- From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org]On Behalf Of Andrew2006 Sent: Thursday, December 27, 2007 9:34 AM To: informix-list@iiug.org Subject: Re: dbaccess - return key does not work?
On Dec 27, 2:13 pm, "Jack Parker" <jack.park...@verizon.net> wrote:
> Let's try that again. dbaccess is not a mouse driven application. You can > highlight the words on the screen all day long, but that action does not [quoted text clipped - 55 lines] > > The page I'm referring to is here:http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic.. .
> bm.sqlt.doc/sqlt65.htm > _______________________________________________ > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list Hi Jack,
I'm not using the mouse to highlight words. I'm only using the keyboard here.
BTW - one reader emailed me re: TERMCAP. TERMCAP is set correctly to / opt/informix/etc/termcap. The termcap file is 1553 lines long, and I assume it's correct.
Thanks
Andrew _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
Andrew2006 - 27 Dec 2007 15:11 GMT > Somehow I got the, now obviously incorrect, impression that you were using > the mouse. Apologies. [quoted text clipped - 107 lines] > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list The arrow keys do work. The Enter keys do not work. They have the same effect as "down arrow".
My TERM is currently set to xterm. I run dbaccess by opening a console in Gnome and sshing into another Linux box where dbaccess is installed. The relevant environment variables on the dbaccess box are: INFORMIXTERM="termcap" TERM="xterm" TERMCAP="/opt/informix/etc/termcap"
As Ctrl-M also appears to be mapped incorrectly (it performs "down arrow"), it looks like the termcap file may be foobared.
Nevermind. In the meantime I can work around it, but it would be nice if worked as intended ...
Many thanks
Andrew
Jack Parker - 27 Dec 2007 17:16 GMT Alas, termcap pre-dates the standard xterm, it may not exist in the standard termcap. Looking through my files, I see that the xterm definitions I came up with were trashed in my (pre-backup, Norton caused) drive crash sometime back. There are some xterm definitions on iiug at http://www.iiug.org/software/archive/termcaps_xterm. Give the iiug version a shot and let me know if it works for you, if not, let me know which keys or features do not and I'll have a look at those.
So to get this all working, copy/paste the definition from the iiug site into the end of your termcap file, call them special names - like xterm1, xterm2 or Phred whatnot - set your TERM environment variable to that value (xterm1, xterm2, Phred) and try dbaccess.
A better answer would be to copy them to your very own termcap file andrews_termcap (or whatnot) and set your TERMCAP variable to point to andrews_termcap (including path) - just to avoid mucking up the "pristine" distribution copy of termcap. The termcap file itself is probably fine, it's just a question of what gnome is sending when you hit the return key. To track that specific one, do:
cat > junk [ENTER] CTRL-D
od -cx junk will show you the octal and character representation of what Gnome/ssh is sending when you press the Enter key. From there you can wander into the termcap file and make that agree with it.
You will see entries like ku=\EOA (KeyUp=Escape-O A) which means that the terminal filter is expecting the keyboard to send that sequence when the up arrow is pressed. There may be a corresponding sequence that the filter is supposed to send when it is attempting to tell the terminal to perform something - like nl=^J (Newline = down arrow). Sequences which are not spelled out are assumed to be the defaults or are inherited from a previous definition.
If you're not into working through all of that, let me know and I would be interested in working with you to resolve any non-working features/keys.
Documentation for the codes is sparse, 'man terminfo', oddly enough, provides the best list I've seen lately. I can't remember where the original termcap keys/features were spelled out.
j.
-----Original Message----- From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org]On Behalf Of Andrew2006 Sent: Thursday, December 27, 2007 10:12 AM To: informix-list@iiug.org Subject: Re: dbaccess - return key does not work?
On Dec 27, 3:09 pm, "Jack Parker" <jack.park...@verizon.net> wrote:
> Somehow I got the, now obviously incorrect, impression that you were using > the mouse. Apologies. [quoted text clipped - 83 lines] > > > The page I'm referring to is here:http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic..
> . > > bm.sqlt.doc/sqlt65.htm [quoted text clipped - 17 lines] > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list The arrow keys do work. The Enter keys do not work. They have the same effect as "down arrow".
My TERM is currently set to xterm. I run dbaccess by opening a console in Gnome and sshing into another Linux box where dbaccess is installed. The relevant environment variables on the dbaccess box are: INFORMIXTERM="termcap" TERM="xterm" TERMCAP="/opt/informix/etc/termcap"
As Ctrl-M also appears to be mapped incorrectly (it performs "down arrow"), it looks like the termcap file may be foobared.
Nevermind. In the meantime I can work around it, but it would be nice if worked as intended ...
Many thanks
Andrew _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
Andrew2006 - 27 Dec 2007 17:45 GMT > Alas, termcap pre-dates the standard xterm, it may not exist in the standard > termcap. Looking through my files, I see that the xterm definitions I came [quoted text clipped - 186 lines] > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list Jack,
This is the result of testing what ssh is sending as "Return": $ od -cx junk 0000000 \n \0 000a 0000001
I created a termcap in my home directory and pointed the environment variable TERMCAP at this.
This contains the following termcap snippet from the iuug site: <termcap> vs|xterm|vs100|xterm terminal emulator (X window system):\ :cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:\ :co#80:li#65:cl=\E[H\E[2J:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A: \ :ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\ :md=\E[1m:mr=\E[7m:me=\E[m:\ :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:kb=^H:\ :k0=\E[11~:k1=\E[12~:k2=\E[13~:k3=\E[14~:k4=\E[15~:\ :k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:k9=\E[21~:\ :kf=\E[6~:kg=\E[5~:\ :kY=\E[216z:kZ=\E[222z:\ :ta=^I:pt:sf=\n:sr=\EM:\ :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:\ :MT:ke=\E[?1l\E>:\ :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:\ :rs=\E[r\E<\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:xn:\ :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\ :ti=\E7\E[?47h\E(B\E)0:te=\E[2J\E[?47l\E8:\ :hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E:\ :gs=^n:ge=^o:gb=lmkjqx: </termcap>
I tried the following replacements for the "nl=^J" entry: - "nl=\n" - "nl=\0" - "nl=000a"
reloading dbaccess each time. None of them changed how the Enter key works. :(
Have just noticed another version of Informix on the dbaccess box in a directory called: informix_10.0UC5 If I run dbaccess from here then the Return key works as expected. / informix_10.0UC5/etc/termcap is identical to /informix/etc/termcap. The bug must therefore be in the version of dbaccess inside /informix/ bin/. Is there a command you can run to find the version of dbaccess you're using?
Sebastian, Norma J. - 27 Dec 2007 17:57 GMT dbaccess -v OR dbaccess -V to see your version. Did you try vt100 just for poos and giggles, sometimes that's a nice generic TERM setting. Norma Jean . . . . ============================================================ The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reproduction, dissemination or distribution of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Tellabs ============================================================
Jack Parker - 27 Dec 2007 22:03 GMT Norma Jean already answered the other part, her suggestion for vt100 is also a good one (I always try wyse-50 and ansi as well). Sounds also as though you have isolated the issue as something else, which is intriguing. I look forward to hearing the version numbers in question and other's thoughts.
The 0000000 is the octal address from od, the \n is what your enter key sent and the 000a is the octal representation of the string. So \n (linefeed) is the value you would be looking for.
I was too lazy to look up the proper code for you before (actually I did, but did not believe that @8 was actually it, so I didn't boot my linux box to check - I have done so now and find the $INFORMIXDIR/etc/termcap entry there contains an xterm entry (below) - which does in fact have an entry for @8. (@8=\EOM or Escape O M). Typing that manually I do not get a \n in the resulting file. I too am using ssh, but from cygwin, I am using ansi for my TERM. Mine also produces \n for both Enter keys.
Looking at termcap, @8 is not typically spelled out, which would indicate that most terminals produce the same value, which I would actually expect to be \r (Carriage Return). I must have something wrong somewhere - K and returns have always been an issue between me and termcap. Mucking about with @8, I get no results from changing it (or nl for that matter). I do get expected results from swapping kd and ku - so it is using my termcap. Hmm, playing around with all of them (nw, nl, cr, @8) none of them have effect - must be something magical about the return key that I am missing. Anyone?
j.
xterm|vs100|xterm terminal emulator:\ :am:km:mi:ms:xn:bs:pt:\ :co#80:it#8:li#65:\ :@8=\EOM:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:\ :IC=\E[%d@:K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:\ :LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:\ :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\ :ae=^O:al=\E[L:as=^N:bl=^G:cb=3\E[1K:cd=\E[J:ce=\E[K:\ :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:eA=\E(B\E)0:ho=\E[H:\ :ic=\E[@:k0=\EOy:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ :k5=\EOt:k6=\EOu:k7=\EOv:k8=\EOl:k9=\EOw:k;=\EOx:\ :kb=\b:kd=\EOB:ke=\E[?1l:kl=\EOD:kr=\EOC:ks=\E[?1h:\ :ku=\EOA:le=\b:mb=@:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:\ :r1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H:\ :r2=@kf1=\EOP:rc=\E8:\ :.sa=!!! MUST CHANGE BY HAND !!!\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t^N%e^O% ;:\ :sc=\E7:se=\E[m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=\t:\ :up=\E[A:
DB-Access Version 10.00.UC5I1. The return key works fine.
Jack,
This is the result of testing what ssh is sending as "Return": $ od -cx junk 0000000 \n \0 000a 0000001
I created a termcap in my home directory and pointed the environment variable TERMCAP at this.
This contains the following termcap snippet from the iuug site: <termcap> vs|xterm|vs100|xterm terminal emulator (X window system):\ :cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:\ :co#80:li#65:cl=\E[H\E[2J:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A: \ :ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\ :md=\E[1m:mr=\E[7m:me=\E[m:\ :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:kb=^H:\ :k0=\E[11~:k1=\E[12~:k2=\E[13~:k3=\E[14~:k4=\E[15~:\ :k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:k9=\E[21~:\ :kf=\E[6~:kg=\E[5~:\ :kY=\E[216z:kZ=\E[222z:\ :ta=^I:pt:sf=\n:sr=\EM:\ :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:\ :MT:ke=\E[?1l\E>:\ :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:\ :rs=\E[r\E<\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:xn:\ :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\ :ti=\E7\E[?47h\E(B\E)0:te=\E[2J\E[?47l\E8:\ :hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E:\ :gs=^n:ge=^o:gb=lmkjqx: </termcap>
I tried the following replacements for the "nl=^J" entry: - "nl=\n" - "nl=\0" - "nl=000a"
reloading dbaccess each time. None of them changed how the Enter key works. :(
Have just noticed another version of Informix on the dbaccess box in a directory called: informix_10.0UC5 If I run dbaccess from here then the Return key works as expected. / informix_10.0UC5/etc/termcap is identical to /informix/etc/termcap. The bug must therefore be in the version of dbaccess inside /informix/ bin/. Is there a command you can run to find the version of dbaccess you're using? _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
Andrew2006 - 27 Dec 2007 22:15 GMT > Norma Jean already answered the other part, her suggestion for vt100 is also > a good one (I always try wyse-50 and ansi as well). Sounds also as though [quoted text clipped - 103 lines] > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list Jack,
The version numbers of the two dbaccess programs is the same. Also the md5sum of the binaries are the same. I've also checked that one is not a symlink to the other. Will look into this more tomorrow...
Many thanks for all the time you've put in to this!
Andrew
Jack Parker - 28 Dec 2007 00:04 GMT Andrew,
Termcap has always been near and dear to my heart, especially since there are elements about it that don't match my understanding.
If the dbaccess binaries are the same, then we are back to environment. hmmm. what about your PATH? is there a third dbaccess binary out there somewhere? Just for grins, from within dbaccess you can escape to the shell with a "!sh", do that and echo your environment into something that you can check later and compare between the two - perhaps there is a different environment getting loaded when you run dbaccess.
I'm headed off for the rest of the week at some point tomorrow, away from email. I won't be ignoring you, just not here.
j.
---
Jack,
The version numbers of the two dbaccess programs is the same. Also the md5sum of the binaries are the same. I've also checked that one is not a symlink to the other. Will look into this more tomorrow...
Many thanks for all the time you've put in to this!
Andrew _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
Andrew2006 - 28 Dec 2007 11:19 GMT > Andrew, > [quoted text clipped - 27 lines] > Informix-list mailing list > Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list Jack,
I ran dbaccess in non-menu mode, escaped to shell and output my environment by typing "set <return>" and "export <return>". I copied the output to a text editor. The two different locations of dbaccess had identical environments except for the PPID and TERMCAP (which I had set differently for each one).
Norma Jean - I'll look into editing the STTY. Jonathon - will try setting the TERMINFO.
Cheers all,
Andrew
Marco Greco - 27 Dec 2007 14:35 GMT >>> Hi there, >>> Can anyone recommend a tutorial for using dbaccess in menu mode? [quoted text clipped - 25 lines] > > Andrew Chances are that there is something wrong with your termcap. RETURN (or ENTER) is indeed what you should be using. Try Control-J or Control-M, and see if it makes a difference
 Signature Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Andrew2006 - 27 Dec 2007 14:40 GMT > >>> Hi there, > >>> Can anyone recommend a tutorial for using dbaccess in menu mode? [quoted text clipped - 38 lines] > 4glworks http://www.4glworks.com > Informix on Linux http://www.4glworks.com/ifmxlinux.htm Hi Marco,
Ctrl-J and Ctrl-M just cause the cursor to move down. :-(
Thanks
Andrew
Jonathan Leffler - 28 Dec 2007 07:04 GMT > Can anyone recommend a tutorial for using dbaccess in menu mode? > [quoted text clipped - 5 lines] > > I am running it from a console in Ubuntu Linux. I agree with the general consensus that the problem is most likely related to terminal handling.
One option no-one else mentioned is setting INFORMIXTERM=terminfo and then using the terminfo entries instead of the termcap entries. You might then need to set TERMINFO=/where/you/terminfo/files/are (but probably would not).
This isn't necessarily a slam dunk - the Informix termcap file is a weird and wonderful thing (but not necessarily updated very often - I'd be mildly surprised if it had been updated in the current millennium, but I might be doing people an injustice).
 Signature Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2007.0914 -- http://dbi.perl.org/ NB: Please do not use this email for correspondence. I don't necessarily read it every week, even.
Andrew2006 - 28 Dec 2007 11:39 GMT On Dec 28, 7:04 am, "Jonathan Leffler" <jleffler.i...@gmail.com> wrote:
> > Can anyone recommend a tutorial for using dbaccess in menu mode? > [quoted text clipped - 26 lines] > NB: Please do not use this email for correspondence. > I don't necessarily read it every week, even. Jonathon,
Tried setting INFORMIXTERM=terminfo, with and without TERMINFO=/usr/ share/terminfo/ Unfortunately no joy there.
Thanks
Andrew
Andrew2006 - 28 Dec 2007 12:13 GMT A colleague found the problem in my .bashrc:
alias dbaccess='rlwrap dbaccess'
I use rlwrap when in non-menu mode as you can view your history of all previous sql queries using the up and down arrows.
When I used the alternative version I was specifying the full path and so not using my alias, hence it worked correctly.
Thankyou everyone for all the help.
Andrew
Jack Parker - 28 Dec 2007 13:08 GMT cool. who would of thunk it!
j.
-----Original Message----- From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org]On Behalf Of Andrew2006 Sent: Friday, December 28, 2007 7:14 AM To: informix-list@iiug.org Subject: Re: dbaccess - return key does not work?
A colleague found the problem in my .bashrc:
alias dbaccess='rlwrap dbaccess'
I use rlwrap when in non-menu mode as you can view your history of all previous sql queries using the up and down arrows.
When I used the alternative version I was specifying the full path and so not using my alias, hence it worked correctly.
Thankyou everyone for all the help.
Andrew _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
|
|
|